gpt-4o-mini-2024-07-18
and later versionsgpt-4o-2024-08-06
and later versionsFor more information on the structured output capabilities of OpenAI series models, please refer to Structured Outputs.
strict: true
in the function definition. When enabled, the Structured Outputs feature ensures that the parameters generated by the LLM for function calls precisely match the JSON schema you provided in the function definition.JSON Schema
and fill in the JSON Schema template. Simultaneously, enable the response_format
column and switch it to the json_schema
format.
name
: Choose a descriptive name for your schema.description
: Briefly explain the purpose of the schema.strict
: true to ensure strict mode.schema
object:
type: "object"
to specify the root level as an object type.properties
object to define all fields.type
and description
.string
, number
, boolean
, array
, object
.items
to define element types.properties
.required
array at each level, listing all required fields.additionalProperties: false
at each object level.enum
to restrict optional values.$ref
to implement recursive structures.required
, For details, please refer to Supported Schemas.