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>
- 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.- Since:
- 1.0.0
- Author:
- Thomas Vitale
-
Field Summary
FieldsFields inherited from class 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 DefaultChatOptionsBuilder
frequencyPenalty, maxTokens, model, presencePenalty, self, stopSequences, temperature, topK, topPMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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>>
-