Interface ToolCallingChatOptions
- All Superinterfaces:
ChatOptions
,ModelOptions
- All Known Implementing Classes:
AnthropicChatOptions
,AzureOpenAiChatOptions
,DeepSeekChatOptions
,DefaultToolCallingChatOptions
,MiniMaxChatOptions
,MistralAiChatOptions
,OllamaOptions
,OpenAiChatOptions
,VertexAiGeminiChatOptions
,ZhiPuAiChatOptions
A set of options that can be used to configure the interaction with a chat model,
including tool calling.
- Since:
- 1.0.0
- Author:
- Thomas Vitale, Ilayaperumal Gopinathan
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A builder to create aToolCallingChatOptions
instance. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
A builder to create a newToolCallingChatOptions
instance.Whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.ToolCallbacks to be registered with the ChatModel.Get the configured tool context.Names of the tools to register with the ChatModel.static boolean
isInternalToolExecutionEnabled
(ChatOptions chatOptions) static List<ToolCallback>
mergeToolCallbacks
(List<ToolCallback> runtimeToolCallbacks, List<ToolCallback> defaultToolCallbacks) mergeToolNames
(Set<String> runtimeToolNames, Set<String> defaultToolNames) 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
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.static void
validateToolCallbacks
(List<ToolCallback> toolCallbacks) Methods inherited from interface org.springframework.ai.chat.prompt.ChatOptions
copy, getFrequencyPenalty, getMaxTokens, getModel, getPresencePenalty, getStopSequences, getTemperature, getTopK, getTopP
-
Field Details
-
DEFAULT_TOOL_EXECUTION_ENABLED
static final boolean DEFAULT_TOOL_EXECUTION_ENABLED- See Also:
-
-
Method Details
-
getToolCallbacks
List<ToolCallback> getToolCallbacks()ToolCallbacks to be registered with the ChatModel. -
setToolCallbacks
Set the ToolCallbacks to be registered with the ChatModel. -
getToolNames
Names of the tools to register with the ChatModel. -
setToolNames
Set the names of the tools to register with the ChatModel. -
getInternalToolExecutionEnabled
Whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller. -
setInternalToolExecutionEnabled
Set whether theChatModel
is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller. -
getToolContext
Get the configured tool context.- Returns:
- the tool context map.
-
setToolContext
Set the tool context values as map.- Parameters:
toolContext
- as map
-
builder
A builder to create a newToolCallingChatOptions
instance.- Returns:
- Returns a new
ChatOptions.Builder
.
-
isInternalToolExecutionEnabled
-
mergeToolNames
-
mergeToolCallbacks
static List<ToolCallback> mergeToolCallbacks(List<ToolCallback> runtimeToolCallbacks, List<ToolCallback> defaultToolCallbacks) -
mergeToolContext
-
validateToolCallbacks
-