Structured final-output contracts for Jido.AI runtimes.
This module validates an agent's final response against an object-shaped schema. It is intentionally independent from any DSL layer: callers provide a Zoi object/map schema or an object-shaped JSON Schema map.
Summary
Functions
Adds output instructions to a ReqLLM message list.
Returns prompt instructions that require the final response to match the schema.
Converts the contract to JSON Schema.
Builds a structured output contract from options.
Builds a structured output contract or raises ArgumentError.
Parses and validates raw model output.
Repairs a raw assistant answer into the configured object shape.
Validates a parsed map against the configured schema.
Types
@type schema_kind() :: :zoi | :json_schema
@type t() :: %Jido.AI.Output{ on_validation_error: validation_mode(), retries: non_neg_integer(), schema: Zoi.schema() | map(), schema_kind: schema_kind() }
@type validation_mode() :: :repair | :error
Functions
Adds output instructions to a ReqLLM message list.
Returns prompt instructions that require the final response to match the schema.
Converts the contract to JSON Schema.
Builds a structured output contract from options.
Builds a structured output contract or raises ArgumentError.
Parses and validates raw model output.
Repairs a raw assistant answer into the configured object shape.
Validates a parsed map against the configured schema.