agentscope-extensions-model-anthropic 接入 Anthropic Claude Model,并提供 Anthropic 专属 formatter 和请求 DTO 支持。
添加依赖
ModelRegistry
设置ANTHROPIC_API_KEY 后,使用 anthropic:<model> 字符串 id:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
agentscope-extensions-model-anthropic 接入 Anthropic Claude Model,并提供 Anthropic 专属 formatter 和请求 DTO 支持。
<dependency>
<groupId>io.agentscope</groupId>
<artifactId>agentscope-extensions-model-anthropic</artifactId>
<version>${agentscope.version}</version>
</dependency>
ANTHROPIC_API_KEY 后,使用 anthropic:<model> 字符串 id:
ReActAgent agent = ReActAgent.builder()
.name("assistant")
.model("anthropic:claude-sonnet-4.5") // 底层由 ModelRegistry.resolve(modelId) 解析
.build();
import io.agentscope.extensions.model.anthropic.AnthropicChatModel;
AnthropicChatModel model = AnthropicChatModel.builder()
.apiKey(System.getenv("ANTHROPIC_API_KEY"))
.modelName("claude-sonnet-4.5")
.stream(true)
.build();
<dependency>
<groupId>io.agentscope</groupId>
<artifactId>agentscope-anthropic-spring-boot-starter</artifactId>
<version>${agentscope.version}</version>
</dependency>