The community member is asking if there is a way to retry matching a certain JSON format, instead of just trying to parse it and re-prompting if it fails. They feel it would be better to have the system correct its mistake instead of retrying entirely. The comments suggest using the OpenAI pydantic program to define the schema, or sending the broken schema to the language model and asking it to correct it. The community member has tried the pydantic program but had issues with it not returning a response sometimes, which is why they are considering going back to using JSON. They are open to the suggestion of sending the broken schema to the model to see if it can correct it, as they thought there might be a built-in way to do this.
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?
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.