added
Structured outputs
4 months ago by Cormick Marskamp
Structured Outputs is a feature that makes sure the model's responses always follow your provided JSON Schema. This means you don't have to worry about the model leaving out any required parts or making up incorrect values.
Why should you use Structured Outputs?
- Reliable format: You don’t have to check or fix responses using the wrong format anymore.
- Clear refusals: When the model refuses something for safety reasons, it’s now easily detectable programmatically.
- Easier prompts: You don’t need to prompt the model to adhere to the schema anymore.
Using Structured Outputs
There are two ways of using the Structured Outputs functionality:
reponse_format
(recommended) - In the dropdown menu (see GIF below), you can select the JSON pill and specify your schema.- Function Calling - In the tool, you can toggle the functionality of the structured output on/off.
Note: Structured Outputs are only available when using the following models:
- gpt-4o 2024-08-06 and later
- gpt-4o-mini 2024-07-18 and later
Reminder: To use Structured Outputs, all fields must be specified as required.
If you want to read more about Structured Outputs, please visit OpenAI's documentation here