Package org.springframework.ai.anthropic
Class AnthropicChatModel.Builder
java.lang.Object
org.springframework.ai.anthropic.AnthropicChatModel.Builder
- Enclosing class:
AnthropicChatModel
Builder for creating
AnthropicChatModel instances.-
Method Summary
Modifier and TypeMethodDescriptionanthropicClient(com.anthropic.client.AnthropicClient anthropicClient) Sets the synchronous Anthropic client.anthropicClientAsync(com.anthropic.client.AnthropicClientAsync anthropicClientAsync) Sets the asynchronous Anthropic client.build()Builds a newAnthropicChatModelinstance.observationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Sets the observation registry for metrics and tracing.options(AnthropicChatOptions options) Sets the chat options.toolCallingManager(ToolCallingManager toolCallingManager) Sets the tool calling manager.toolExecutionEligibilityPredicate(ToolExecutionEligibilityPredicate toolExecutionEligibilityPredicate) Sets the predicate to determine tool execution eligibility.
-
Method Details
-
anthropicClient
public AnthropicChatModel.Builder anthropicClient(com.anthropic.client.AnthropicClient anthropicClient) Sets the synchronous Anthropic client.- Parameters:
anthropicClient- the synchronous client- Returns:
- this builder
-
anthropicClientAsync
public AnthropicChatModel.Builder anthropicClientAsync(com.anthropic.client.AnthropicClientAsync anthropicClientAsync) Sets the asynchronous Anthropic client.- Parameters:
anthropicClientAsync- the asynchronous client- Returns:
- this builder
-
options
Sets the chat options.- Parameters:
options- the chat options- Returns:
- this builder
-
toolCallingManager
Sets the tool calling manager.- Parameters:
toolCallingManager- the tool calling manager- Returns:
- this builder
-
observationRegistry
public AnthropicChatModel.Builder observationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Sets the observation registry for metrics and tracing.- Parameters:
observationRegistry- the observation registry- Returns:
- this builder
-
toolExecutionEligibilityPredicate
public AnthropicChatModel.Builder toolExecutionEligibilityPredicate(ToolExecutionEligibilityPredicate toolExecutionEligibilityPredicate) Sets the predicate to determine tool execution eligibility.- Parameters:
toolExecutionEligibilityPredicate- the predicate- Returns:
- this builder
-
build
Builds a newAnthropicChatModelinstance.- Returns:
- the configured chat model
-