Class DefaultToolCallingChatOptions.Builder
java.lang.Object
org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder
- All Implemented Interfaces:
ChatOptions.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()Build theChatOptions.frequencyPenalty(Double frequencyPenalty) Builds with the frequency penalty to use for the chat.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.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.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:ToolCallingChatOptions.BuilderAdd aMapof context values into tool context.- Specified by:
toolContextin interfaceToolCallingChatOptions.Builder- Parameters:
context- the map representing the tool context.- Returns:
- the
ToolCallingChatOptionsBuilder.
-
toolContext
Description copied from interface:ToolCallingChatOptions.BuilderAdd a specific key/value pair to the tool context.- Specified by:
toolContextin interfaceToolCallingChatOptions.Builder- Parameters:
key- the key to use.value- the corresponding value.- Returns:
- the
ToolCallingChatOptionsBuilder.
-
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
-
model
Description copied from interface:ChatOptions.BuilderBuilds with the model to use for the chat.- Specified by:
modelin interfaceChatOptions.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 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 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 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 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 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 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 interfaceToolCallingChatOptions.Builder- Returns:
- the builder.
-
build
Description copied from interface:ChatOptions.BuilderBuild theChatOptions.- Specified by:
buildin interfaceChatOptions.Builder- Specified by:
buildin interfaceToolCallingChatOptions.Builder- Returns:
- the Chat options.
-