Class DefaultToolCallingChatOptions.Builder<B extends DefaultToolCallingChatOptions.Builder<B>>
java.lang.Object
org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder<B>
org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder<B>
- All Implemented Interfaces:
ChatOptions.Builder<B>,ToolCallingChatOptions.Builder<B>
- Direct Known Subclasses:
AnthropicChatOptions.AbstractBuilder,AzureOpenAiChatOptions.AbstractBuilder,BedrockChatOptions.AbstractBuilder,DeepSeekChatOptions.AbstractBuilder,GoogleGenAiChatOptions.AbstractBuilder,MiniMaxChatOptions.AbstractBuilder,MistralAiChatOptions.AbstractBuilder,OllamaChatOptions.AbstractBuilder,OpenAiSdkChatOptions.AbstractBuilder,ZhiPuAiChatOptions.AbstractBuilder
- Enclosing class:
DefaultToolCallingChatOptions
public static class DefaultToolCallingChatOptions.Builder<B extends DefaultToolCallingChatOptions.Builder<B>>
extends DefaultChatOptionsBuilder<B>
implements ToolCallingChatOptions.Builder<B>
Default implementation of
ToolCallingChatOptions.Builder.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable Booleanprotected @Nullable List<ToolCallback> Fields inherited from class org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder
frequencyPenalty, maxTokens, model, presencePenalty, stopSequences, temperature, topK, topP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theChatOptions.combineWith(ChatOptions.Builder<?> other) Mutate this builder by taking allother's values that are non-null, retainingthisother values.internalToolExecutionEnabled(@Nullable Boolean internalToolExecutionEnabled) Whether theChatModelis responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.toolCallbacks(@Nullable 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(@Nullable 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.Methods inherited from class org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder
frequencyPenalty, maxTokens, model, presencePenalty, self, stopSequences, temperature, topK, topPMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.model.tool.ToolCallingChatOptions.Builder
frequencyPenalty, maxTokens, model, presencePenalty, stopSequences, temperature, topK, topP
-
Field Details
-
toolCallbacks
-
toolNames
-
toolContext
-
internalToolExecutionEnabled
-
-
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<B extends DefaultToolCallingChatOptions.Builder<B>>
-
toolCallbacks
Description copied from interface:ToolCallingChatOptions.BuilderToolCallbacks to be registered with the ChatModel.- Specified by:
toolCallbacksin interfaceToolCallingChatOptions.Builder<B extends DefaultToolCallingChatOptions.Builder<B>>
-
toolNames
Description copied from interface:ToolCallingChatOptions.BuilderNames of the tools to register with the ChatModel.- Specified by:
toolNamesin interfaceToolCallingChatOptions.Builder<B extends DefaultToolCallingChatOptions.Builder<B>>
-
toolNames
Description copied from interface:ToolCallingChatOptions.BuilderNames of the tools to register with the ChatModel.- Specified by:
toolNamesin interfaceToolCallingChatOptions.Builder<B extends DefaultToolCallingChatOptions.Builder<B>>
-
toolContext
Description copied from interface:ToolCallingChatOptions.BuilderAdd aMapof context values into tool context.- Specified by:
toolContextin interfaceToolCallingChatOptions.Builder<B extends DefaultToolCallingChatOptions.Builder<B>>- 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<B extends DefaultToolCallingChatOptions.Builder<B>>- Parameters:
key- the key to use.value- the corresponding value.- Returns:
- the
ToolCallingChatOptionsBuilder.
-
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<B extends DefaultToolCallingChatOptions.Builder<B>>
-
build
Description copied from interface:ChatOptions.BuilderBuild theChatOptions.- Specified by:
buildin interfaceChatOptions.Builder<B extends DefaultToolCallingChatOptions.Builder<B>>- Specified by:
buildin interfaceToolCallingChatOptions.Builder<B extends DefaultToolCallingChatOptions.Builder<B>>- Overrides:
buildin classDefaultChatOptionsBuilder<B extends DefaultToolCallingChatOptions.Builder<B>>- Returns:
- the Chat options.
-
combineWith
Description copied from interface:ChatOptions.BuilderMutate this builder by taking allother's values that are non-null, retainingthisother values.- Specified by:
combineWithin interfaceChatOptions.Builder<B extends DefaultToolCallingChatOptions.Builder<B>>- Overrides:
combineWithin classDefaultChatOptionsBuilder<B extends DefaultToolCallingChatOptions.Builder<B>>
-