Find answers from the community

Updated 3 months ago

Is there a way to retry matching a

Is there a way to retry matching a certain JSON format? Right now i just try to parse it and re-prompt if it fails. But i feel it would be better to just have it correct its mistake instead of retrying enterly right? Is this possible?
W
L
M
6 comments
Did you try OpenAI pydantic program: https://docs.llamaindex.ai/en/stable/examples/output_parsing/openai_pydantic_program.html

You can define the schema in which you want the response.
You could also send the LLM the broken schema and ask it to correct it πŸ€”
Yes Ive tried the pydantic program, but actually had issues with it not returning a response sometimes... thats why im considering going to back to using JSON.
@Logan M yea that seems like a good option. I though maybe there was some build in way of doing this
I'll try resending the broken schema and see if that works
We've been meaning to make this builtin somehow -- but that sounds good πŸ‘
Add a reply
Sign up and join the conversation on Discord