Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unstructured Output #1469

Open
1 task done
collindutter opened this issue Dec 19, 2024 · 0 comments
Open
1 task done

Unstructured Output #1469

collindutter opened this issue Dec 19, 2024 · 0 comments
Labels
type: feature request New feature or request
Milestone

Comments

@collindutter
Copy link
Member

collindutter commented Dec 19, 2024

Is your feature request related to a problem? Please describe.
Users want some way to get structured output like behavior for non-deterministic output. For instance, if I've got a Rule that says "Talk like a Pirate", I want something that automatically enforces (and automatically corrects) an LLM to output that way.

Describe the solution you'd like

  • Use EvalEngine to automatically evaluate output on whether it follows the provided Rulesets.
  • Provide a custom function that can do whatever kind of check they'd like.
    Describe alternatives you've considered
    Build the loop myself:
from griptape.engines import EvalEngine
from griptape.structures import Pipeline
from griptape.tasks import PromptTask

engine = EvalEngine(
    criteria="Determine whether the answer is spoken like a pirate.",
    evaluation_params=[EvalEngine.Param.INPUT, EvalEngine.Param.ACTUAL_OUTPUT],
)


pipeline = Pipeline(
    tasks=[
        PromptTask("What is 2 + 2? {% if args and args[0] %}{{ args[0] }}{% endif %}"),
    ]
)


score = -1
reason = None
while score < 0.5:
    pipeline.run(reason)
    score, reason = engine.evaluate(input=pipeline.input, actual_output=pipeline.output)
@collindutter collindutter added the type:enhancement Improvements to existing features label Dec 19, 2024
@collindutter collindutter added this to the 2.0 milestone Dec 19, 2024
@collindutter collindutter added type: feature request New feature or request and removed type:enhancement Improvements to existing features labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant