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

[feat] Option to customize converter instructions for pydantic output #799

Open
eelkevdbos opened this issue Jun 19, 2024 · 0 comments · May be fixed by #800
Open

[feat] Option to customize converter instructions for pydantic output #799

eelkevdbos opened this issue Jun 19, 2024 · 0 comments · May be fixed by #800

Comments

@eelkevdbos
Copy link

eelkevdbos commented Jun 19, 2024

Currently, the instruction to convert raw llm output to structured pydantic models is hardcoded to: "I'm gonna convert this raw text into valid JSON.". I ran into some cases where this resulted in incorrect transformations with "too much" JSON.

For example with this simple pydantic model:

...
class SimpleResult(BaseModel):
  result: str

Often times, when the llm would output a simple scalar value, it would start to improvise leading to something resembling:

SimpleResult(result='{"result": "1"}')
@eelkevdbos eelkevdbos changed the title Option to customize converter instructions for pydantic output [feat] Option to customize converter instructions for pydantic output Jun 19, 2024
eelkevdbos added a commit to eelkevdbos/crewAI that referenced this issue Jun 19, 2024
@eelkevdbos eelkevdbos linked a pull request Jun 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant