Provider Configuration
UseLLMConfig to choose which provider and model to connect to. The simplest approach
is a preset name that maps to your environment variables:
StructuredOutput directly from a preset:
Runtime Configuration
StructuredOutputRuntime holds behavior that is shared across many requests. Create one
runtime and reuse it throughout your application:
Runtime Settings
Advanced Configuration With StructuredOutputConfig
For fine-grained control, build a StructuredOutputConfig directly:
StructuredOutputConfig includes settings for:
- Output mode — which structured output strategy to use
- Retry behavior — max retries and the prompt sent on validation failure
- Tool metadata — tool name and description for
OutputMode::Tools - Schema metadata — schema name and description
- Mode prompts — per-mode prompt templates (e.g., how JSON Schema is embedded)
- Chat structure — the ordering of prompt sections
- Deserialization — error prompt template,
stdClassfallback, object references
Request Configuration
StructuredOutput handles per-request concerns. These are the things that change from
one call to the next: