AS AgentScopeAPI 手册 / API Reference

AnthropicToolsHelper

public class AnthropicToolsHelper
源码Source io/agentscope/extensions/model/anthropic/formatter/AnthropicToolsHelper.java:43–278

Anthropic 工具 Helper,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.anthropic.formatter 包。核心成员包括 applyTools、applyOptions。

Helper class for tool registration and option application for Anthropic API.

方法摘要Method Summary

方法Method说明Description
public static void applyTools(MessageCreateParams.Builder builder, List<ToolSchema> tools, GenerateOptions options)
static
应用工具。
Apply tools to the message create params builder.
public static void applyTools(MessageCreateParams.Builder builder, List<ToolSchema> tools, GenerateOptions options, String cacheTtl)
static
应用工具。
Apply tools to the message create params builder with an optional cache TTL.
public static void applyOptions(MessageCreateParams.Builder builder, GenerateOptions options, GenerateOptions defaultOptions)
static
应用选项。
Apply generation options to the builder.

方法详情Method Detail

applyTools

public static void applyTools(MessageCreateParams.Builder builder, List<ToolSchema> tools, GenerateOptions options)
static

应用工具。

Apply tools to the message create params builder.

参数Parameters
名称Name类型Type说明Description
builderMessageCreateParams.Builder消息创建参数构建器。The message create params builder
toolsList<ToolSchema>工具模式的列出。List of tool schemas
optionsGenerateOptions选项(类型 `GenerateOptions`)。Generate options containing tool choice
源码Source io/agentscope/extensions/model/anthropic/formatter/AnthropicToolsHelper.java:54–57

applyTools

public static void applyTools(MessageCreateParams.Builder builder, List<ToolSchema> tools, GenerateOptions options, String cacheTtl)
static

应用工具。

Apply tools to the message create params builder with an optional cache TTL.

参数Parameters
名称Name类型Type说明Description
builderMessageCreateParams.Builder消息创建参数构建器。The message create params builder
toolsList<ToolSchema>工具模式的列出。List of tool schemas
optionsGenerateOptions选项(类型 `GenerateOptions`)。Generate options containing tool choice
cacheTtlString缓存存活时间(类型 `String`)。TTL for ephemeral cache control (null/empty for default 5m)
源码Source io/agentscope/extensions/model/anthropic/formatter/AnthropicToolsHelper.java:67–110

applyOptions

public static void applyOptions(MessageCreateParams.Builder builder, GenerateOptions options, GenerateOptions defaultOptions)
static

应用选项。

Apply generation options to the builder.

参数Parameters
名称Name类型Type说明Description
builderMessageCreateParams.Builder消息创建参数构建器。The message create params builder
optionsGenerateOptions选项(类型 `GenerateOptions`)。Generate options
defaultOptionsGenerateOptions默认选项(类型 `GenerateOptions`)。Default generate options
源码Source io/agentscope/extensions/model/anthropic/formatter/AnthropicToolsHelper.java:182–222
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.