flâneur — a map of the web's best reading

Structured Outputs - OpenAI API

platform.openai.com · saved by 1 readers

Structured Outputs is a feature that ensures the model will always generate responses that adhere to your supplied JSON Schema, so you don't need to worry about the model omitting a required key, or hallucinating an invalid enum value. Some benefits of Structed Outputs include: In addition to supporting JSON Schema in the REST API, the OpenAI SDKs for Python and JavaScript also make it easy to define object schemas using Pydantic and Zod respectively. Below, you can see how to extract information from unstructured text that conforms to a schema defined in code. Structured Outputs are available in our latest large language models, starting with GPT-4o: Older models like gpt-4-turbo and earlier may use JSON mode instead. When to use Structured Outputs via function calling vs via response_format Structured Outputs is available in two forms in the OpenAI API: Function calling is useful when you are building an application that bridges the models and functionality of your application. For e

Structured Outputs is a feature that ensures the model will always generate responses that adhere to your supplied JSON Schema, so you don't need to worry about the model omitting a required key, or hallucinating an invalid enum value. Some benefits of Structed Outputs include: In addition to supporting JSON Schema in the REST API, the OpenAI SDKs for Python and JavaScript also make it easy to define object schemas using Pydantic and Zod respectively. Below, you can see how to extract information from unstructured text that conforms to a schema defined in code. Structured Outputs are available

Explore this link on the map →