Class DefaultToolCallingChatOptions.Builder
java.lang.Object
org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder
- All Implemented Interfaces:
ChatOptions.Builder
,FunctionCallingOptions.Builder
,ToolCallingChatOptions.Builder
- Enclosing class:
- DefaultToolCallingChatOptions
public static class DefaultToolCallingChatOptions.Builder
extends Object
implements ToolCallingChatOptions.Builder
Default implementation of
ToolCallingChatOptions.Builder
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theFunctionCallingOptions
.frequencyPenalty
(Double frequencyPenalty) Builds with the frequency penalty to use for the chat.Deprecated.functionCallbacks
(List<FunctionCallback> functionCallbacks) Deprecated.functionCallbacks
(FunctionCallback... functionCallbacks) Deprecated.Deprecated.Builds with the maximum number of tokens to use for the chat.Builds with the model to use for the chat.presencePenalty
(Double presencePenalty) Builds with the presence penalty to use for the chat.proxyToolCalls
(Boolean proxyToolCalls) Deprecated.stopSequences
(List<String> stopSequences) Builds with the stop sequences to use for the chat.temperature
(Double temperature) Builds with the temperature to use for the chat.toolCallbacks
(List<ToolCallback> toolCallbacks) ToolCallbacks to be registered with the ChatModel.toolCallbacks
(ToolCallback... toolCallbacks) ToolCallbacks to be registered with the ChatModel.toolCallReturnDirect
(Boolean toolCallReturnDirect) Whether the result of each tool call should be returned directly or passed back to the model.toolContext
(String key, Object value) Add a specific key/value pair to the tool context.toolContext
(Map<String, Object> context) Add aMap
of context values into tool context.Names of the tools to register with the ChatModel.Names of the tools to register with the ChatModel.Builds with the top K to use for the chat.Builds with the top P to use for the chat.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
toolCallbacks
Description copied from interface:ToolCallingChatOptions.Builder
ToolCallbacks to be registered with the ChatModel.- Specified by:
toolCallbacks
in interfaceToolCallingChatOptions.Builder
-
toolCallbacks
Description copied from interface:ToolCallingChatOptions.Builder
ToolCallbacks to be registered with the ChatModel.- Specified by:
toolCallbacks
in interfaceToolCallingChatOptions.Builder
-
tools
Description copied from interface:ToolCallingChatOptions.Builder
Names of the tools to register with the ChatModel.- Specified by:
tools
in interfaceToolCallingChatOptions.Builder
-
tools
Description copied from interface:ToolCallingChatOptions.Builder
Names of the tools to register with the ChatModel.- Specified by:
tools
in interfaceToolCallingChatOptions.Builder
-
toolContext
Description copied from interface:FunctionCallingOptions.Builder
Add aMap
of context values into tool context.- Specified by:
toolContext
in interfaceFunctionCallingOptions.Builder
- Specified by:
toolContext
in interfaceToolCallingChatOptions.Builder
- Parameters:
context
- the map representing the tool context.- Returns:
- the FunctionCallOptions Builder.
-
toolContext
Description copied from interface:FunctionCallingOptions.Builder
Add a specific key/value pair to the tool context.- Specified by:
toolContext
in interfaceFunctionCallingOptions.Builder
- Specified by:
toolContext
in interfaceToolCallingChatOptions.Builder
- Parameters:
key
- the key to use.value
- the corresponding value.- Returns:
- the FunctionCallOptions Builder.
-
toolCallReturnDirect
Description copied from interface:ToolCallingChatOptions.Builder
Whether the result of each tool call should be returned directly or passed back to the model. It can be overridden for eachToolCallback
instance viaToolMetadata.returnDirect()
.- Specified by:
toolCallReturnDirect
in interfaceToolCallingChatOptions.Builder
-
functionCallbacks
@Deprecated public ToolCallingChatOptions.Builder functionCallbacks(List<FunctionCallback> functionCallbacks) Deprecated.Description copied from interface:FunctionCallingOptions.Builder
The list of Function Callbacks to be registered with the Chat model.- Specified by:
functionCallbacks
in interfaceFunctionCallingOptions.Builder
- Specified by:
functionCallbacks
in interfaceToolCallingChatOptions.Builder
- Parameters:
functionCallbacks
- the list of Function Callbacks.- Returns:
- the FunctionCallOptions Builder.
-
functionCallbacks
@Deprecated public ToolCallingChatOptions.Builder functionCallbacks(FunctionCallback... functionCallbacks) Deprecated.Description copied from interface:FunctionCallingOptions.Builder
The Function Callbacks to be registered with the Chat model.- Specified by:
functionCallbacks
in interfaceFunctionCallingOptions.Builder
- Specified by:
functionCallbacks
in interfaceToolCallingChatOptions.Builder
- Parameters:
functionCallbacks
- the function callbacks.- Returns:
- the FunctionCallOptions Builder.
-
functions
Deprecated.Description copied from interface:FunctionCallingOptions.Builder
Set
of function names to be registered with the Chat model.- Specified by:
functions
in interfaceFunctionCallingOptions.Builder
- Specified by:
functions
in interfaceToolCallingChatOptions.Builder
- Parameters:
functions
- theSet
of function names- Returns:
- the FunctionCallOptions Builder.
-
function
Deprecated.Description copied from interface:FunctionCallingOptions.Builder
The function name to be registered with the chat model.- Specified by:
function
in interfaceFunctionCallingOptions.Builder
- Specified by:
function
in interfaceToolCallingChatOptions.Builder
- Parameters:
function
- the name of the function.- Returns:
- the FunctionCallOptions Builder.
-
proxyToolCalls
Deprecated.Description copied from interface:FunctionCallingOptions.Builder
Boolean flag to indicate if the proxy ToolCalls is enabled.- Specified by:
proxyToolCalls
in interfaceFunctionCallingOptions.Builder
- Specified by:
proxyToolCalls
in interfaceToolCallingChatOptions.Builder
- Parameters:
proxyToolCalls
- boolean value to enable proxy ToolCalls.- Returns:
- the FunctionCallOptions Builder.
-
model
Description copied from interface:ChatOptions.Builder
Builds with the model to use for the chat.- Specified by:
model
in interfaceChatOptions.Builder
- Specified by:
model
in interfaceFunctionCallingOptions.Builder
- Specified by:
model
in interfaceToolCallingChatOptions.Builder
- Returns:
- the builder
-
frequencyPenalty
Description copied from interface:ChatOptions.Builder
Builds with the frequency penalty to use for the chat.- Specified by:
frequencyPenalty
in interfaceChatOptions.Builder
- Specified by:
frequencyPenalty
in interfaceFunctionCallingOptions.Builder
- Specified by:
frequencyPenalty
in interfaceToolCallingChatOptions.Builder
- Returns:
- the builder.
-
maxTokens
Description copied from interface:ChatOptions.Builder
Builds with the maximum number of tokens to use for the chat.- Specified by:
maxTokens
in interfaceChatOptions.Builder
- Specified by:
maxTokens
in interfaceFunctionCallingOptions.Builder
- Specified by:
maxTokens
in interfaceToolCallingChatOptions.Builder
- Returns:
- the builder.
-
presencePenalty
Description copied from interface:ChatOptions.Builder
Builds with the presence penalty to use for the chat.- Specified by:
presencePenalty
in interfaceChatOptions.Builder
- Specified by:
presencePenalty
in interfaceFunctionCallingOptions.Builder
- Specified by:
presencePenalty
in interfaceToolCallingChatOptions.Builder
- Returns:
- the builder.
-
stopSequences
Description copied from interface:ChatOptions.Builder
Builds with the stop sequences to use for the chat.- Specified by:
stopSequences
in interfaceChatOptions.Builder
- Specified by:
stopSequences
in interfaceFunctionCallingOptions.Builder
- Specified by:
stopSequences
in interfaceToolCallingChatOptions.Builder
- Returns:
- the builder.
-
temperature
Description copied from interface:ChatOptions.Builder
Builds with the temperature to use for the chat.- Specified by:
temperature
in interfaceChatOptions.Builder
- Specified by:
temperature
in interfaceFunctionCallingOptions.Builder
- Specified by:
temperature
in interfaceToolCallingChatOptions.Builder
- Returns:
- the builder.
-
topK
Description copied from interface:ChatOptions.Builder
Builds with the top K to use for the chat.- Specified by:
topK
in interfaceChatOptions.Builder
- Specified by:
topK
in interfaceFunctionCallingOptions.Builder
- Specified by:
topK
in interfaceToolCallingChatOptions.Builder
- Returns:
- the builder.
-
topP
Description copied from interface:ChatOptions.Builder
Builds with the top P to use for the chat.- Specified by:
topP
in interfaceChatOptions.Builder
- Specified by:
topP
in interfaceFunctionCallingOptions.Builder
- Specified by:
topP
in interfaceToolCallingChatOptions.Builder
- Returns:
- the builder.
-
build
Description copied from interface:FunctionCallingOptions.Builder
Builds theFunctionCallingOptions
.- Specified by:
build
in interfaceChatOptions.Builder
- Specified by:
build
in interfaceFunctionCallingOptions.Builder
- Specified by:
build
in interfaceToolCallingChatOptions.Builder
- Returns:
- the FunctionCalling options.
-