Hi guys! Has anyone managed to get the Structured response format working ? It's an option of the openAI models that permits to ask for a specific json format for the response, but it seems completely ignored by Dust 😕
it’s working on my side, what is your issue ?
Working on my side also if the structured format is described in the prompt
I noticed that as well, if I describe it in the prompt it's better, but I still get it returned as a string starting by : " ```json myJson ``` " And sometimes the return doesn't respect at all the keys (new invented keys are added). I'm used to the native sdk of openAI that returns a real json (not in a string) and really respect the schema, but here I couldn't have something similar
Example of one of my Structured Response Format that is working 100% of the time (only available on openAI models): If it can help
{
"type": "json_schema",
"json_schema": {
"name": "categoryAnswerabilitySchema",
"strict": true,
"schema": {
"type": "object",
"properties": {
"category": {
"type": "string",
"description": "Must be the exact parent category from the reference data"
},
"subcategory": {
"type": "string",
"description": "Must be a subcategory that belongs to the specified category"
},
"ai_answerable": {
"type": "boolean",
"description": "Indicates if the subcategory is answerable by AI"
}
},
"required": ["category", "subcategory", "ai_answerable"],
"additionalProperties": false
}
}
}
Thank you for the example! Are you mentioning something specific in the prompt in order to follow this schema ? Are you getting the response in a real JSON or in a string that you need to parse (for me I get that in the content field of the response)
Kyllian Vinkler I do a JSON.parse() of the content
Indeed, in the prompt in case of:
OUTPUT FORMAT:
You must return a JSON object with the following structure:
{
"category": "string", // Must be the exact parent category from the reference data
"subcategory": "string", // Must be a subcategory that belongs to the specified category
"ai_answerable": boolean
}
Ok thanks! I talked with the support and apparently GPT-5 isn't really following the json properly all the time so it should be better with previous models
I noticed the same, GPT-5 ignored it multiple times, but the 4point models are consistent & sufficient