Interface StructuredOutputChatOptions
- All Superinterfaces:
ChatOptions,ModelOptions
- All Known Implementing Classes:
AnthropicChatOptions,BedrockChatOptions,DefaultStructuredOutputChatOptions,GoogleGenAiChatOptions,MistralAiChatOptions,OllamaChatOptions,OpenAiChatOptions
Mixin interface for ChatModels that support structured output. Provides a unified way
to set and get the output JSON schema.
- Author:
- Christian Tzolov
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionstatic StructuredOutputChatOptions.Builder<?>builder()A builder to create a newStructuredOutputChatOptionsinstance.@Nullable Stringmutate()Returns a newStructuredOutputChatOptions.Builderinitialized with the values of thisStructuredOutputChatOptions.Methods inherited from interface org.springframework.ai.chat.prompt.ChatOptions
getFrequencyPenalty, getMaxTokens, getModel, getPresencePenalty, getStopSequences, getTemperature, getTopK, getTopP
-
Method Details
-
getOutputSchema
@Nullable String getOutputSchema() -
mutate
StructuredOutputChatOptions.Builder<?> mutate()Returns a newStructuredOutputChatOptions.Builderinitialized with the values of thisStructuredOutputChatOptions. Narrows the return type ofChatOptions.mutate()so generic structured output code can chainstructuredOptions.mutate().outputSchema(schema).build()without casting.- Specified by:
mutatein interfaceChatOptions
-
builder
A builder to create a newStructuredOutputChatOptionsinstance.- Returns:
- Returns a new
ChatOptions.Builder.
-