Class Claude.Builder

java.lang.Object
com.google.adk.models.Claude.Builder
Enclosing class:
Claude

public static final class Claude.Builder extends Object
Builder for Claude.
  • Method Details

    • modelName

      @CanIgnoreReturnValue public Claude.Builder modelName(String modelName)
      Sets the name of the Claude model to use. Required.
      Parameters:
      modelName - The model name (e.g., "claude-sonnet-4-5").
      Returns:
      This builder.
    • anthropicClient

      @CanIgnoreReturnValue public Claude.Builder anthropicClient(com.anthropic.client.AnthropicClient anthropicClient)
      Sets the Anthropic API client that sends the requests. Required.
      Parameters:
      anthropicClient - The client instance.
      Returns:
      This builder.
    • maxTokens

      @CanIgnoreReturnValue public Claude.Builder maxTokens(int maxTokens)
      Sets the max_tokens sent when the request config does not set maxOutputTokens. Defaults to 8192.
      Parameters:
      maxTokens - The maximum number of tokens to generate.
      Returns:
      This builder.
    • effort

      @CanIgnoreReturnValue public Claude.Builder effort(@Nullable com.anthropic.models.messages.OutputConfig.Effort effort)
      Sets how much reasoning effort Claude spends on each request. If unset, the model's default applies.
      Parameters:
      effort - The reasoning effort, or null for the model's default.
      Returns:
      This builder.
    • build

      public Claude build()
      Builds the Claude instance.
      Returns:
      A new Claude instance.
      Throws:
      NullPointerException - if modelName or anthropicClient is not set.