Skip to main content
V4 returns the agent’s final answer as a string in run.result. Ask the agent for JSON only, then validate it with Pydantic or Zod in your application.
V4 does not currently accept an output_schema / outputSchema request field. Validation happens client-side.
For strict production flows, handle JSON parse or validation failures and retry with a follow-up message that includes the validation error.