Class AzureOpenAiChatOptions
java.lang.Object
org.springframework.ai.azure.openai.AzureOpenAiChatOptions
- All Implemented Interfaces:
ChatOptions
,FunctionCallingOptions
,ModelOptions
,ToolCallingChatOptions
The configuration information for a chat completions request. Completions support a
wide variety of tasks and generate text that continues from or "completes" provided
prompt data.
- Author:
- Christian Tzolov, Thomas Vitale, Soby Chacko, Ilayaperumal Gopinathan
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.springframework.ai.model.tool.ToolCallingChatOptions
DEFAULT_TOOL_EXECUTION_ENABLED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
A builder to create a newToolCallingChatOptions
instance.copy()
Returns a copy of thisChatOptions
.static AzureOpenAiChatOptions
fromOptions
(AzureOpenAiChatOptions fromOptions) com.azure.ai.openai.models.AzureChatEnhancementConfiguration
Returns the frequency penalty to use for the chat.Deprecated.Deprecated.Returns the maximum number of tokens to use for the chat.getModel()
Returns the model to use for the chat.getN()
Returns the presence penalty to use for the chat.Deprecated.getSeed()
getStop()
Returns the stop sequences to use for the chat.com.azure.ai.openai.models.ChatCompletionStreamOptions
Returns the temperature to use for the chat.ToolCallbacks to be registered with the ChatModel.Names of the tools to register with the ChatModel.getTopK()
Returns the top K to use for the chat.getTopP()
Returns the top P to use for the chat.getUser()
Whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.void
setDeploymentName
(String deploymentName) void
setEnhancements
(com.azure.ai.openai.models.AzureChatEnhancementConfiguration enhancements) void
setFrequencyPenalty
(Double frequencyPenalty) void
setFunctionCallbacks
(List<FunctionCallback> functionCallbacks) Deprecated.void
setFunctions
(Set<String> functions) Set the list of function names from the ChatModel registry to be used in the next chat completion requests.void
setInternalToolExecutionEnabled
(Boolean internalToolExecutionEnabled) Set whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.void
setLogitBias
(Map<String, Integer> logitBias) void
setLogprobs
(Boolean logprobs) void
setMaxTokens
(Integer maxTokens) void
void
void
setPresencePenalty
(Double presencePenalty) void
setProxyToolCalls
(Boolean proxyToolCalls) Deprecated.void
setResponseFormat
(AzureOpenAiResponseFormat responseFormat) void
void
void
setStopSequences
(List<String> stopSequences) void
setStreamOptions
(com.azure.ai.openai.models.ChatCompletionStreamOptions streamOptions) void
setTemperature
(Double temperature) void
setToolCallbacks
(List<FunctionCallback> toolCallbacks) Set the ToolCallbacks to be registered with the ChatModel.void
setToolContext
(Map<String, Object> toolContext) void
setToolNames
(Set<String> toolNames) Set the names of the tools to register with the ChatModel.void
setTopLogProbs
(Integer topLogProbs) void
void
-
Constructor Details
-
AzureOpenAiChatOptions
public AzureOpenAiChatOptions()
-
-
Method Details
-
getToolCallbacks
Description copied from interface:ToolCallingChatOptions
ToolCallbacks to be registered with the ChatModel.- Specified by:
getToolCallbacks
in interfaceToolCallingChatOptions
-
setToolCallbacks
Description copied from interface:ToolCallingChatOptions
Set the ToolCallbacks to be registered with the ChatModel.- Specified by:
setToolCallbacks
in interfaceToolCallingChatOptions
-
getToolNames
Description copied from interface:ToolCallingChatOptions
Names of the tools to register with the ChatModel.- Specified by:
getToolNames
in interfaceToolCallingChatOptions
-
setToolNames
Description copied from interface:ToolCallingChatOptions
Set the names of the tools to register with the ChatModel.- Specified by:
setToolNames
in interfaceToolCallingChatOptions
-
isInternalToolExecutionEnabled
Description copied from interface:ToolCallingChatOptions
Whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.- Specified by:
isInternalToolExecutionEnabled
in interfaceToolCallingChatOptions
-
setInternalToolExecutionEnabled
Description copied from interface:ToolCallingChatOptions
Set whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.- Specified by:
setInternalToolExecutionEnabled
in interfaceToolCallingChatOptions
-
builder
Description copied from interface:ToolCallingChatOptions
A builder to create a newToolCallingChatOptions
instance.- Returns:
- Returns
DefaultFunctionCallingOptionsBuilder
to create a new instance ofFunctionCallingOptions
.
-
fromOptions
-
getMaxTokens
Description copied from interface:ChatOptions
Returns the maximum number of tokens to use for the chat.- Specified by:
getMaxTokens
in interfaceChatOptions
- Returns:
- the maximum number of tokens to use for the chat
-
setMaxTokens
-
getLogitBias
-
setLogitBias
-
getUser
-
setUser
-
getN
-
setN
-
getStopSequences
Description copied from interface:ChatOptions
Returns the stop sequences to use for the chat.- Specified by:
getStopSequences
in interfaceChatOptions
- Returns:
- the stop sequences to use for the chat
-
setStopSequences
-
getStop
-
setStop
-
getPresencePenalty
Description copied from interface:ChatOptions
Returns the presence penalty to use for the chat.- Specified by:
getPresencePenalty
in interfaceChatOptions
- Returns:
- the presence penalty to use for the chat
-
setPresencePenalty
-
getFrequencyPenalty
Description copied from interface:ChatOptions
Returns the frequency penalty to use for the chat.- Specified by:
getFrequencyPenalty
in interfaceChatOptions
- Returns:
- the frequency penalty to use for the chat
-
setFrequencyPenalty
-
getModel
Description copied from interface:ChatOptions
Returns the model to use for the chat.- Specified by:
getModel
in interfaceChatOptions
- Returns:
- the model to use for the chat
-
setModel
-
getDeploymentName
-
setDeploymentName
-
getTemperature
Description copied from interface:ChatOptions
Returns the temperature to use for the chat.- Specified by:
getTemperature
in interfaceChatOptions
- Returns:
- the temperature to use for the chat
-
setTemperature
-
getTopP
Description copied from interface:ChatOptions
Returns the top P to use for the chat.- Specified by:
getTopP
in interfaceChatOptions
- Returns:
- the top P to use for the chat
-
setTopP
-
getFunctionCallbacks
Deprecated.Description copied from interface:FunctionCallingOptions
Function Callbacks to be registered with the ChatModel. For Prompt Options the functionCallbacks are automatically enabled for the duration of the prompt execution. For Default Options the FunctionCallbacks are registered but disabled by default. You have to use "functions" property to list the function names from the ChatModel registry to be used in the chat completion requests.- Specified by:
getFunctionCallbacks
in interfaceFunctionCallingOptions
- Returns:
- Return the Function Callbacks to be registered with the ChatModel.
-
setFunctionCallbacks
Deprecated.Description copied from interface:FunctionCallingOptions
Set the Function Callbacks to be registered with the ChatModel.- Specified by:
setFunctionCallbacks
in interfaceFunctionCallingOptions
- Parameters:
functionCallbacks
- the Function Callbacks to be registered with the ChatModel.
-
getFunctions
Deprecated.- Specified by:
getFunctions
in interfaceFunctionCallingOptions
- Returns:
Set
of function names from the ChatModel registry to be used in the next chat completion requests.
-
setFunctions
Description copied from interface:FunctionCallingOptions
Set the list of function names from the ChatModel registry to be used in the next chat completion requests.- Specified by:
setFunctions
in interfaceFunctionCallingOptions
- Parameters:
functions
- the list of function names from the ChatModel registry to be used in the next chat completion requests.
-
getResponseFormat
-
setResponseFormat
-
getTopK
Description copied from interface:ChatOptions
Returns the top K to use for the chat.- Specified by:
getTopK
in interfaceChatOptions
- Returns:
- the top K to use for the chat
-
getSeed
-
setSeed
-
isLogprobs
-
setLogprobs
-
getTopLogProbs
-
setTopLogProbs
-
getEnhancements
public com.azure.ai.openai.models.AzureChatEnhancementConfiguration getEnhancements() -
setEnhancements
public void setEnhancements(com.azure.ai.openai.models.AzureChatEnhancementConfiguration enhancements) -
getProxyToolCalls
Deprecated.- Specified by:
getProxyToolCalls
in interfaceFunctionCallingOptions
-
setProxyToolCalls
Deprecated.- Specified by:
setProxyToolCalls
in interfaceFunctionCallingOptions
-
getToolContext
- Specified by:
getToolContext
in interfaceFunctionCallingOptions
-
setToolContext
- Specified by:
setToolContext
in interfaceFunctionCallingOptions
-
getStreamOptions
public com.azure.ai.openai.models.ChatCompletionStreamOptions getStreamOptions() -
setStreamOptions
public void setStreamOptions(com.azure.ai.openai.models.ChatCompletionStreamOptions streamOptions) -
copy
Description copied from interface:ChatOptions
Returns a copy of thisChatOptions
.- Specified by:
copy
in interfaceChatOptions
- Returns:
- a copy of this
ChatOptions
-