Class AzureOpenAiChatOptions.AbstractBuilder<B extends AzureOpenAiChatOptions.AbstractBuilder<B>>
java.lang.Object
org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder<B>
org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder<B>
org.springframework.ai.azure.openai.AzureOpenAiChatOptions.AbstractBuilder<B>
- All Implemented Interfaces:
ChatOptions.Builder<B>,ToolCallingChatOptions.Builder<B>
- Direct Known Subclasses:
AzureOpenAiChatOptions.Builder
- Enclosing class:
AzureOpenAiChatOptions
protected abstract static class AzureOpenAiChatOptions.AbstractBuilder<B extends AzureOpenAiChatOptions.AbstractBuilder<B>>
extends DefaultToolCallingChatOptions.Builder<B>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable Booleanprotected @Nullable com.azure.ai.openai.models.AzureChatEnhancementConfigurationprotected @Nullable Booleanprotected @Nullable Integerprotected @Nullable Integerprotected @Nullable Stringprotected @Nullable AzureOpenAiResponseFormatprotected @Nullable Longprotected @Nullable com.azure.ai.openai.models.ChatCompletionStreamOptionsprotected @Nullable Integerprotected @Nullable StringFields inherited from class org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder
internalToolExecutionEnabled, toolCallbacks, toolContext, toolNamesFields inherited from class org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder
frequencyPenalty, maxTokens, model, presencePenalty, stopSequences, temperature, topK, topP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theChatOptions.combineWith(ChatOptions.Builder<?> other) Mutate this builder by taking allother's values that are non-null, retainingthisother values.deploymentName(@Nullable String deploymentName) enhancements(@Nullable com.azure.ai.openai.models.AzureChatEnhancementConfiguration enhancements) maxCompletionTokens(@Nullable Integer maxCompletionTokens) Sets an upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.Sets the maximum number of tokens to generate in the chat completion.reasoningEffort(@Nullable String reasoningEffort) responseFormat(@Nullable AzureOpenAiResponseFormat responseFormat) streamOptions(@Nullable com.azure.ai.openai.models.ChatCompletionStreamOptions streamOptions) streamUsage(@Nullable Boolean enableStreamUsage) topLogprobs(@Nullable Integer topLogprobs) Methods inherited from class org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder
internalToolExecutionEnabled, toolCallbacks, toolCallbacks, toolContext, toolContext, toolNames, toolNamesMethods inherited from class org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder
frequencyPenalty, model, presencePenalty, self, stopSequences, temperature, topK, topPMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.model.tool.ToolCallingChatOptions.Builder
frequencyPenalty, model, presencePenalty, stopSequences, temperature, topK, topP
-
Field Details
-
logitBias
-
user
-
n
-
responseFormat
-
seed
-
logprobs
-
topLogProbs
-
maxCompletionTokens
-
enhancements
protected @Nullable com.azure.ai.openai.models.AzureChatEnhancementConfiguration enhancements -
streamOptions
protected @Nullable com.azure.ai.openai.models.ChatCompletionStreamOptions streamOptions -
enableStreamUsage
-
reasoningEffort
-
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()
-
-
Method Details
-
deploymentName
-
logitBias
-
maxTokens
Sets the maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.Model-specific usage:
- Use for non-reasoning models (e.g., gpt-4o, gpt-3.5-turbo)
- Cannot be used with reasoning models (e.g., o1, o3, o4-mini series)
Mutual exclusivity: This parameter cannot be used together with
maxCompletionTokens(Integer). If both are set, the last one set will be used and the other will be cleared with a warning.- Specified by:
maxTokensin interfaceChatOptions.Builder<B extends AzureOpenAiChatOptions.AbstractBuilder<B>>- Specified by:
maxTokensin interfaceToolCallingChatOptions.Builder<B extends AzureOpenAiChatOptions.AbstractBuilder<B>>- Overrides:
maxTokensin classDefaultChatOptionsBuilder<B extends AzureOpenAiChatOptions.AbstractBuilder<B>>- Parameters:
maxTokens- the maximum number of tokens to generate, or null to unset- Returns:
- this builder instance
-
maxCompletionTokens
Sets an upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.Model-specific usage:
- Required for reasoning models (e.g., o1, o3, o4-mini series)
- Cannot be used with non-reasoning models (e.g., gpt-4o, gpt-3.5-turbo)
Mutual exclusivity: This parameter cannot be used together with
maxTokens(Integer). If both are set, the last one set will be used and the other will be cleared with a warning.- Parameters:
maxCompletionTokens- the maximum number of completion tokens to generate, or null to unset- Returns:
- this builder instance
-
N
-
stop
-
user
-
responseFormat
-
streamUsage
-
reasoningEffort
-
seed
-
logprobs
-
topLogprobs
-
enhancements
public B enhancements(@Nullable com.azure.ai.openai.models.AzureChatEnhancementConfiguration enhancements) -
streamOptions
public B streamOptions(@Nullable com.azure.ai.openai.models.ChatCompletionStreamOptions streamOptions) -
combineWith
Description copied from interface:ChatOptions.BuilderMutate this builder by taking allother's values that are non-null, retainingthisother values.- Specified by:
combineWithin interfaceChatOptions.Builder<B extends AzureOpenAiChatOptions.AbstractBuilder<B>>- Overrides:
combineWithin classDefaultToolCallingChatOptions.Builder<B extends AzureOpenAiChatOptions.AbstractBuilder<B>>
-
build
Description copied from interface:ChatOptions.BuilderBuild theChatOptions.- Specified by:
buildin interfaceChatOptions.Builder<B extends AzureOpenAiChatOptions.AbstractBuilder<B>>- Specified by:
buildin interfaceToolCallingChatOptions.Builder<B extends AzureOpenAiChatOptions.AbstractBuilder<B>>- Overrides:
buildin classDefaultToolCallingChatOptions.Builder<B extends AzureOpenAiChatOptions.AbstractBuilder<B>>- Returns:
- the Chat options.
-