类:Claude.Builder
java.lang.Object
com.google.adk.models.Claude.Builder
- Enclosing class:
Claude
-
方法概述
Modifier and TypeMethodDescriptionanthropicClient(com.anthropic.client.AnthropicClient anthropicClient) 用于设置用于发送请求的 Anthropic API 客户端。build()构建(Builds the)Claude`instance.`effort(@Nullable com.anthropic.models.messages.OutputConfig.Effort effort) 该参数决定了 Claude 在处理每个请求时需要投入多少推理(即分析数据、生成答案等)的精力。maxTokens(int maxTokens) 设置max_tokens当请求配置未设置 `maxOutputTokens` 时,该消息会被发送。用于设置要使用的 Claude 模型的名称。
-
方法详细信息(Method Details)
-
modelName
设置要使用的 Claude 模型的名称。此字段为必填项。- 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) 用于设置用于发送请求的 Anthropic API 客户端。此字段为必填项。- Parameters:
anthropicClient- The client instance.- Returns:
- This builder.
-
maxTokens
设置max_tokens当请求配置未设置 `maxOutputTokens` 时,会发送该消息。 默认值为 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) 该参数用于设置 Claude 在处理每个请求时需要投入的推理资源(即计算能力)。如果未设置该参数,则模型会使用其默认的配置。- Parameters:
effort- The reasoning effort, or null for the model's default.- Returns:
- This builder.
-
build
构建(Builds the)Claude`instance.`- Returns:
- A new
Claudeinstance. - Throws:
NullPointerException- if modelName or anthropicClient is not set.
-