You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
...
classSimpleResult(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"}')
The text was updated successfully, but these errors were encountered:
eelkevdbos
changed the title
Option to customize converter instructions for pydantic output
[feat] Option to customize converter instructions for pydantic output
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:
Often times, when the llm would output a simple scalar value, it would start to improvise leading to something resembling:
The text was updated successfully, but these errors were encountered: