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
Constructors -
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.internalToolExecutionEnabled(Boolean internalToolExecutionEnabled) Whether theChatModelis responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.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<FunctionCallback> toolCallbacks) ToolCallbacks to be registered with the ChatModel.toolCallbacks(FunctionCallback... toolCallbacks) ToolCallbacks to be registered with the ChatModel.toolContext(String key, Object value) Add a specific key/value pair to the tool context.toolContext(Map<String, Object> context) Add aMapof 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.BuilderToolCallbacks to be registered with the ChatModel.- Specified by:
toolCallbacksin interfaceToolCallingChatOptions.Builder
-
toolCallbacks
Description copied from interface:ToolCallingChatOptions.BuilderToolCallbacks to be registered with the ChatModel.- Specified by:
toolCallbacksin interfaceToolCallingChatOptions.Builder
-
toolNames
Description copied from interface:ToolCallingChatOptions.BuilderNames of the tools to register with the ChatModel.- Specified by:
toolNamesin interfaceToolCallingChatOptions.Builder
-
toolNames
Description copied from interface:ToolCallingChatOptions.BuilderNames of the tools to register with the ChatModel.- Specified by:
toolNamesin interfaceToolCallingChatOptions.Builder
-
toolContext
Description copied from interface:FunctionCallingOptions.BuilderAdd aMapof context values into tool context.- Specified by:
toolContextin interfaceFunctionCallingOptions.Builder- Specified by:
toolContextin interfaceToolCallingChatOptions.Builder- Parameters:
context- the map representing the tool context.- Returns:
- the FunctionCallOptions Builder.
-
toolContext
Description copied from interface:FunctionCallingOptions.BuilderAdd a specific key/value pair to the tool context.- Specified by:
toolContextin interfaceFunctionCallingOptions.Builder- Specified by:
toolContextin interfaceToolCallingChatOptions.Builder- Parameters:
key- the key to use.value- the corresponding value.- Returns:
- the FunctionCallOptions Builder.
-
internalToolExecutionEnabled
public ToolCallingChatOptions.Builder internalToolExecutionEnabled(@Nullable Boolean internalToolExecutionEnabled) Description copied from interface:ToolCallingChatOptions.BuilderWhether theChatModelis responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.- Specified by:
internalToolExecutionEnabledin interfaceToolCallingChatOptions.Builder
-
functionCallbacks
@Deprecated public ToolCallingChatOptions.Builder functionCallbacks(List<FunctionCallback> functionCallbacks) Deprecated.Description copied from interface:FunctionCallingOptions.BuilderThe list of Function Callbacks to be registered with the Chat model.- Specified by:
functionCallbacksin interfaceFunctionCallingOptions.Builder- Specified by:
functionCallbacksin 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.BuilderThe Function Callbacks to be registered with the Chat model.- Specified by:
functionCallbacksin interfaceFunctionCallingOptions.Builder- Specified by:
functionCallbacksin interfaceToolCallingChatOptions.Builder- Parameters:
functionCallbacks- the function callbacks.- Returns:
- the FunctionCallOptions Builder.
-
functions
Deprecated.Description copied from interface:FunctionCallingOptions.BuilderSetof function names to be registered with the Chat model.- Specified by:
functionsin interfaceFunctionCallingOptions.Builder- Specified by:
functionsin interfaceToolCallingChatOptions.Builder- Parameters:
functions- theSetof function names- Returns:
- the FunctionCallOptions Builder.
-
function
Deprecated.Description copied from interface:FunctionCallingOptions.BuilderThe function name to be registered with the chat model.- Specified by:
functionin interfaceFunctionCallingOptions.Builder- Specified by:
functionin interfaceToolCallingChatOptions.Builder- Parameters:
function- the name of the function.- Returns:
- the FunctionCallOptions Builder.
-
proxyToolCalls
Deprecated.Description copied from interface:FunctionCallingOptions.BuilderBoolean flag to indicate if the proxy ToolCalls is enabled.- Specified by:
proxyToolCallsin interfaceFunctionCallingOptions.Builder- Specified by:
proxyToolCallsin interfaceToolCallingChatOptions.Builder- Parameters:
proxyToolCalls- boolean value to enable proxy ToolCalls.- Returns:
- the FunctionCallOptions Builder.
-
model
Description copied from interface:ChatOptions.BuilderBuilds with the model to use for the chat.- Specified by:
modelin interfaceChatOptions.Builder- Specified by:
modelin interfaceFunctionCallingOptions.Builder- Specified by:
modelin interfaceToolCallingChatOptions.Builder- Returns:
- the builder
-
frequencyPenalty
Description copied from interface:ChatOptions.BuilderBuilds with the frequency penalty to use for the chat.- Specified by:
frequencyPenaltyin interfaceChatOptions.Builder- Specified by:
frequencyPenaltyin interfaceFunctionCallingOptions.Builder- Specified by:
frequencyPenaltyin interfaceToolCallingChatOptions.Builder- Returns:
- the builder.
-
maxTokens
Description copied from interface:ChatOptions.BuilderBuilds with the maximum number of tokens to use for the chat.- Specified by:
maxTokensin interfaceChatOptions.Builder- Specified by:
maxTokensin interfaceFunctionCallingOptions.Builder- Specified by:
maxTokensin interfaceToolCallingChatOptions.Builder- Returns:
- the builder.
-
presencePenalty
Description copied from interface:ChatOptions.BuilderBuilds with the presence penalty to use for the chat.- Specified by:
presencePenaltyin interfaceChatOptions.Builder- Specified by:
presencePenaltyin interfaceFunctionCallingOptions.Builder- Specified by:
presencePenaltyin interfaceToolCallingChatOptions.Builder- Returns:
- the builder.
-
stopSequences
Description copied from interface:ChatOptions.BuilderBuilds with the stop sequences to use for the chat.- Specified by:
stopSequencesin interfaceChatOptions.Builder- Specified by:
stopSequencesin interfaceFunctionCallingOptions.Builder- Specified by:
stopSequencesin interfaceToolCallingChatOptions.Builder- Returns:
- the builder.
-
temperature
Description copied from interface:ChatOptions.BuilderBuilds with the temperature to use for the chat.- Specified by:
temperaturein interfaceChatOptions.Builder- Specified by:
temperaturein interfaceFunctionCallingOptions.Builder- Specified by:
temperaturein interfaceToolCallingChatOptions.Builder- Returns:
- the builder.
-
topK
Description copied from interface:ChatOptions.BuilderBuilds with the top K to use for the chat.- Specified by:
topKin interfaceChatOptions.Builder- Specified by:
topKin interfaceFunctionCallingOptions.Builder- Specified by:
topKin interfaceToolCallingChatOptions.Builder- Returns:
- the builder.
-
topP
Description copied from interface:ChatOptions.BuilderBuilds with the top P to use for the chat.- Specified by:
topPin interfaceChatOptions.Builder- Specified by:
topPin interfaceFunctionCallingOptions.Builder- Specified by:
topPin interfaceToolCallingChatOptions.Builder- Returns:
- the builder.
-
build
Description copied from interface:FunctionCallingOptions.BuilderBuilds theFunctionCallingOptions.- Specified by:
buildin interfaceChatOptions.Builder- Specified by:
buildin interfaceFunctionCallingOptions.Builder- Specified by:
buildin interfaceToolCallingChatOptions.Builder- Returns:
- the FunctionCalling options.
-