Skip to main content

Module schema

Module schema 

Source
Expand description

JSON Schema validation for structured agent outputs.

Constants§

STRUCTURED_OUTPUT_MAX_RETRIES
Max corrective re-samples when structured output fails validation.

Functions§

compile_schema
Compile a JSON Schema once per turn (or once per agent definition).
schema_retry_reminder
Build a corrective user reminder after a schema failure.
validate_structured_output
Parse model text as JSON and validate against a compiled schema.