Class AnthropicChatOptions.Builder
java.lang.Object
org.springframework.ai.anthropic.AnthropicChatOptions.Builder
- Enclosing class:
AnthropicChatOptions
- Since:
- 1.0.0
- Author:
- Christian Tzolov, Thomas Vitale, Alexandros Pappas, Ilayaperumal Gopinathan, Soby Chacko, Austin Dase
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCitationDocument(CitationDocument document) Add a single citation document.anthropicSkill(AnthropicApi.AnthropicSkill anthropicSkill) Add an Anthropic pre-built skill (xlsx, pptx, docx, pdf).anthropicSkill(AnthropicApi.AnthropicSkill anthropicSkill, String version) Add an Anthropic pre-built skill with specific version.build()cacheOptions(AnthropicCacheOptions cacheOptions) citationDocuments(List<CitationDocument> citationDocuments) Set citation documents for the request.citationDocuments(CitationDocument... documents) Set citation documents from variable arguments.customSkill(String skillId) Add a custom skill by ID.customSkill(String skillId, String version) Add a custom skill with specific version.httpHeaders(Map<String, String> httpHeaders) internalToolExecutionEnabled(Boolean internalToolExecutionEnabled) model(AnthropicApi.ChatModel model) outputFormat(AnthropicApi.ChatCompletionRequest.OutputFormat outputFormat) outputSchema(String outputSchema) skill(AnthropicApi.Skill skill) Add a single skill to the request.skillContainer(AnthropicApi.SkillContainer skillContainer) Set the Skills container for this request.stopSequences(List<String> stopSequences) temperature(Double temperature) thinking(AnthropicApi.ThinkingType type, Integer budgetTokens) toolCallbacks(List<org.springframework.ai.tool.ToolCallback> toolCallbacks) toolCallbacks(org.springframework.ai.tool.ToolCallback... toolCallbacks) toolChoice(AnthropicApi.ToolChoice toolChoice) toolContext(Map<String, Object> toolContext)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
model
-
model
-
maxTokens
-
metadata
-
stopSequences
-
temperature
-
topP
-
topK
-
toolChoice
-
thinking
public AnthropicChatOptions.Builder thinking(AnthropicApi.ChatCompletionRequest.ThinkingConfig thinking) -
thinking
-
toolCallbacks
public AnthropicChatOptions.Builder toolCallbacks(List<org.springframework.ai.tool.ToolCallback> toolCallbacks) -
toolCallbacks
public AnthropicChatOptions.Builder toolCallbacks(org.springframework.ai.tool.ToolCallback... toolCallbacks) -
toolNames
-
toolNames
-
internalToolExecutionEnabled
public AnthropicChatOptions.Builder internalToolExecutionEnabled(@Nullable Boolean internalToolExecutionEnabled) -
toolContext
-
httpHeaders
-
cacheOptions
-
citationDocuments
Set citation documents for the request.- Parameters:
citationDocuments- List of documents to include for citations- Returns:
- Builder for method chaining
-
citationDocuments
Set citation documents from variable arguments.- Parameters:
documents- Variable number of CitationDocument objects- Returns:
- Builder for method chaining
-
addCitationDocument
Add a single citation document.- Parameters:
document- Citation document to add- Returns:
- Builder for method chaining
-
outputFormat
public AnthropicChatOptions.Builder outputFormat(AnthropicApi.ChatCompletionRequest.OutputFormat outputFormat) -
outputSchema
-
skillContainer
Set the Skills container for this request.- Parameters:
skillContainer- Container with skills to make available- Returns:
- Builder for method chaining
-
skill
Add a single skill to the request. Creates a SkillContainer if one doesn't exist.- Parameters:
skill- Skill to add- Returns:
- Builder for method chaining
-
anthropicSkill
Add an Anthropic pre-built skill (xlsx, pptx, docx, pdf).Example:
AnthropicChatOptions options = AnthropicChatOptions.builder() .model("claude-sonnet-4-5") .anthropicSkill(AnthropicSkill.XLSX) .anthropicSkill(AnthropicSkill.PPTX) .build();- Parameters:
anthropicSkill- Pre-built Anthropic skill to add- Returns:
- Builder for method chaining
-
anthropicSkill
public AnthropicChatOptions.Builder anthropicSkill(AnthropicApi.AnthropicSkill anthropicSkill, String version) Add an Anthropic pre-built skill with specific version.- Parameters:
anthropicSkill- Pre-built Anthropic skill to addversion- Version of the skill (e.g., "latest", "20251013")- Returns:
- Builder for method chaining
-
customSkill
Add a custom skill by ID.- Parameters:
skillId- Custom skill ID- Returns:
- Builder for method chaining
-
customSkill
Add a custom skill with specific version.- Parameters:
skillId- Custom skill IDversion- Version of the skill- Returns:
- Builder for method chaining
-
build
-