Class DefaultToolCallingChatOptions
java.lang.Object
org.springframework.ai.model.tool.DefaultToolCallingChatOptions
- All Implemented Interfaces:
ChatOptions
,ModelOptions
,ToolCallingChatOptions
Default implementation of
ToolCallingChatOptions
.- Since:
- 1.0.0
- Author:
- Thomas Vitale
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Default implementation ofToolCallingChatOptions.Builder
. -
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.<T extends ChatOptions>
Tcopy()
Returns a copy of thisChatOptions
.Returns the frequency penalty to use for the chat.Whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.Returns the maximum number of tokens to use for the chat.getModel()
Returns the model to use for the chat.Returns the presence penalty to use for the chat.Returns the stop sequences to use for the chat.Returns the temperature to use for the chat.ToolCallbacks to be registered with the ChatModel.Get the configured tool context.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.void
setFrequencyPenalty
(Double frequencyPenalty) 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
setMaxTokens
(Integer maxTokens) void
void
setPresencePenalty
(Double presencePenalty) void
setStopSequences
(List<String> stopSequences) void
setTemperature
(Double temperature) void
setToolCallbacks
(List<ToolCallback> toolCallbacks) Set the ToolCallbacks to be registered with the ChatModel.void
setToolContext
(Map<String, Object> toolContext) Set the tool context values as map.void
setToolNames
(Set<String> toolNames) Set the names of the tools to register with the ChatModel.void
void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.model.tool.ToolCallingChatOptions
isInternalToolExecutionEnabled
-
Constructor Details
-
DefaultToolCallingChatOptions
public DefaultToolCallingChatOptions()
-
-
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
-
getToolContext
Description copied from interface:ToolCallingChatOptions
Get the configured tool context.- Specified by:
getToolContext
in interfaceToolCallingChatOptions
- Returns:
- the tool context map.
-
setToolContext
Description copied from interface:ToolCallingChatOptions
Set the tool context values as map.- Specified by:
setToolContext
in interfaceToolCallingChatOptions
- Parameters:
toolContext
- as map
-
getInternalToolExecutionEnabled
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:
getInternalToolExecutionEnabled
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
setTopK
-
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
-
copy
Description copied from interface:ChatOptions
Returns a copy of thisChatOptions
.- Specified by:
copy
in interfaceChatOptions
- Returns:
- a copy of this
ChatOptions
-
builder
Description copied from interface:ToolCallingChatOptions
A builder to create a newToolCallingChatOptions
instance.- Returns:
- Returns a new
ChatOptions.Builder
.
-