Class AnthropicChatModel.Builder

java.lang.Object
org.springframework.ai.anthropic.AnthropicChatModel.Builder
Enclosing class:
AnthropicChatModel

public static final class AnthropicChatModel.Builder extends Object
Builder for creating AnthropicChatModel instances.
  • 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

      public AnthropicChatModel.Builder toolCallingManager(ToolCallingManager 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

      public AnthropicChatModel build()
      Builds a new AnthropicChatModel instance.
      Returns:
      the configured chat model