Package org.springframework.ai.anthropic
Class AnthropicChatOptions.AbstractBuilder<B extends AnthropicChatOptions.AbstractBuilder<B>>
java.lang.Object
org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder<B>
org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder<B>
org.springframework.ai.anthropic.AnthropicChatOptions.AbstractBuilder<B>
- All Implemented Interfaces:
ChatOptions.Builder<B>,StructuredOutputChatOptions.Builder<B>,ToolCallingChatOptions.Builder<B>
- Direct Known Subclasses:
AnthropicChatOptions.Builder
- Enclosing class:
AnthropicChatOptions
protected abstract static class AnthropicChatOptions.AbstractBuilder<B extends AnthropicChatOptions.AbstractBuilder<B>>
extends DefaultToolCallingChatOptions.Builder<B>
implements StructuredOutputChatOptions.Builder<B>
-
Field Summary
Fields inherited from class org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder
internalToolExecutionEnabled, toolCallbacks, toolContext, toolNamesFields inherited from class org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder
frequencyPenalty, maxTokens, model, presencePenalty, stopSequences, temperature, topK, topP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCitationDocument(AnthropicCitationDocument citationDocument) build()Build theChatOptions.cacheOptions(AnthropicCacheOptions cacheOptions) citationDocuments(List<AnthropicCitationDocument> citationDocuments) citationDocuments(AnthropicCitationDocument... citationDocuments) combineWith(ChatOptions.Builder<?> other) Mutate this builder by taking allother's values that are non-null, retainingthisother values.customHeaders(Map<String, String> customHeaders) disableParallelToolUse(@Nullable Boolean disableParallelToolUse) effort(com.anthropic.models.messages.OutputConfig.Effort effort) Convenience method to set the effort level for the model's response.httpHeaders(Map<String, String> httpHeaders) maxRetries(@Nullable Integer maxRetries) metadata(@Nullable com.anthropic.models.messages.Metadata metadata) model(@Nullable com.anthropic.models.messages.Model model) outputConfig(@Nullable com.anthropic.models.messages.OutputConfig outputConfig) Sets the output configuration for controlling response format and effort.outputSchema(@Nullable String outputSchema) skill(AnthropicSkill anthropicSkill) skill(AnthropicSkillRecord skill) skill(AnthropicSkill anthropicSkill, String version) skillContainer(@Nullable AnthropicSkillContainer skillContainer) thinking(@Nullable com.anthropic.models.messages.ThinkingConfigParam thinking) Convenience method to let Claude adaptively decide whether to think.Convenience method to explicitly disable thinking.thinkingEnabled(long budgetTokens) Convenience method to enable thinking with a specific budget in tokens.toolChoice(@Nullable com.anthropic.models.messages.ToolChoice toolChoice) Methods inherited from class org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder
internalToolExecutionEnabled, toolCallbacks, toolCallbacks, toolContext, toolContext, toolNames, toolNamesMethods 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
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()
-
-
Method Details
-
outputSchema
- Specified by:
outputSchemain interfaceStructuredOutputChatOptions.Builder<B extends AnthropicChatOptions.AbstractBuilder<B>>
-
baseUrl
-
apiKey
-
timeout
-
maxRetries
-
proxy
-
customHeaders
-
model
-
metadata
-
toolChoice
-
thinking
-
thinkingEnabled
Convenience method to enable thinking with a specific budget in tokens.- Parameters:
budgetTokens- the thinking budget (must be >= 1024 and invalid input: '<' maxTokens)
-
thinkingAdaptive
Convenience method to let Claude adaptively decide whether to think. -
thinkingDisabled
Convenience method to explicitly disable thinking. -
disableParallelToolUse
-
citationDocuments
-
citationDocuments
-
addCitationDocument
-
cacheOptions
-
outputConfig
Sets the output configuration for controlling response format and effort.- Parameters:
outputConfig- the output configuration- Returns:
- this builder
-
effort
Convenience method to set the effort level for the model's response.- Parameters:
effort- the desired effort level (LOW, MEDIUM, HIGH, MAX)- Returns:
- this builder
-
httpHeaders
-
skillContainer
-
skill
-
skill
-
skill
-
skill
-
skill
-
skills
-
skills
-
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 AnthropicChatOptions.AbstractBuilder<B>>- Overrides:
combineWithin classDefaultToolCallingChatOptions.Builder<B extends AnthropicChatOptions.AbstractBuilder<B>>
-
build
Description copied from interface:ChatOptions.BuilderBuild theChatOptions.- Specified by:
buildin interfaceChatOptions.Builder<B extends AnthropicChatOptions.AbstractBuilder<B>>- Specified by:
buildin interfaceToolCallingChatOptions.Builder<B extends AnthropicChatOptions.AbstractBuilder<B>>- Overrides:
buildin classDefaultToolCallingChatOptions.Builder<B extends AnthropicChatOptions.AbstractBuilder<B>>- Returns:
- the Chat options.
-