User
schema using structured outputs via OpenAI’s gpt-4o
model. The agent will then return the User
object as-is.
use_json_mode=True
.
JSON mode works by injecting a detailed description of the expected JSON structure into the system prompt. The model is then instructed to return a valid JSON object that follows this structure. Unlike Structured Outputs, the response is not automatically validated against the schema at the API level.