Replies: 3 comments
-
Are you tier 3 in the API? The structured outputs are only supported if you are tier 3, meaning you need to have spent at least $500 (all time) on the API. |
Beta Was this translation helpful? Give feedback.
-
Ha yes, I didn't saw that ! thank you ! :) |
Beta Was this translation helpful? Give feedback.
-
So what does this all time mean ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm using the Chat Completion API and trying to enforce a specific response_format by injecting a json_schema into my payload. However, despite specifying the schema, the API continues to return responses in Markdown format. Below is an example of the payload I'm sending:
{
"model": "sonar",
"messages": [
{
"role": "system",
"content": "Act as a tour guide"
},
{
"role": "user",
"content": "Can you give me the best restaurant in Paris?"
}
],
"response_format": {
"type": "json_schema",
"json_schema": {
"schema": {
"type": "object",
"properties": {
"restaurantName": { "type": "string" },
"restaurantPrice": { "type": "string" },
"restaurantUserRating": { "type": "string" },
"restaurantAddress": { "type": "string" },
"restaurantArea": { "type": "string" },
"restaurantType": {
"type": "string",
"enum": ["thai", "french", "african"]
},
"restaurantCuisine": { "type": "string" },
"restaurantDescription": { "type": "string" }
}
}
}
},
"temperature": 0.7
}
The API consistently returns responses in Markdown format rather than adhering to the provided JSON schema.
I expected the API to generate a JSON response formatted according to the schema I defined.
Is the response_format parameter with a json_schema type supported in the API?
If it is supported, am I using the correct syntax for the payload?
Are there any additional steps or settings I need to configure to ensure the schema is respected?
Any guidance on this issue would be greatly appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions