Class Claude.Builder
java.lang.Object
com.google.adk.models.Claude.Builder
- Enclosing class:
Claude
-
Method Summary
Modifier and TypeMethodDescriptionanthropicClient(com.anthropic.client.AnthropicClient anthropicClient) Sets the Anthropic API client that sends the requests.build()Builds theClaudeinstance.effort(@Nullable com.anthropic.models.messages.OutputConfig.Effort effort) Sets how much reasoning effort Claude spends on each request.maxTokens(int maxTokens) Sets themax_tokenssent when the request config does not set maxOutputTokens.Sets the name of the Claude model to use.
-
Method Details
-
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
Sets themax_tokenssent 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
Builds theClaudeinstance.- Returns:
- A new
Claudeinstance. - Throws:
NullPointerException- if modelName or anthropicClient is not set.
-