StructuredOutputConfig
Configures structured output behavior. Defines which structures in which modes should be used for each provider when requesting a structured output.
Constructors
Properties
A map matching LLMProvider to compatible StructuredOutput definitions. Each provider may require different schema formats. E.g. for JsonStructuredData this means you have to use the appropriate JsonSchemaGenerator implementation for each provider for StructuredOutput.Native, or fallback to StructuredOutput.Manual
Fallback StructuredOutput to be used when there's no suitable structure found in byProvider for a requested LLMProvider. Defaults to null
, meaning structured output would fail with error in such a case.
Optional parser that handles malformed responses by using an auxiliary LLM to intelligently fix parsing errors. When specified, parsing errors trigger additional LLM calls with error context to attempt correction of the structure format.
Functions
Retrieves the structured data configuration for a specific large language model (LLM).
Updates a given prompt to configure structured output using the specified large language model (LLM). Depending on the model's support for structured outputs, the prompt is updated either manually or natively.