Class AnthropicToolsHelper
java.lang.Object
io.agentscope.extensions.model.anthropic.formatter.AnthropicToolsHelper
Helper class for tool registration and option application for Anthropic API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyOptions(com.anthropic.models.messages.MessageCreateParams.Builder builder, io.agentscope.core.model.GenerateOptions options, io.agentscope.core.model.GenerateOptions defaultOptions) Apply generation options to the builder.static voidapplyTools(com.anthropic.models.messages.MessageCreateParams.Builder builder, List<io.agentscope.core.model.ToolSchema> tools, io.agentscope.core.model.GenerateOptions options) Apply tools to the message create params builder.static voidapplyTools(com.anthropic.models.messages.MessageCreateParams.Builder builder, List<io.agentscope.core.model.ToolSchema> tools, io.agentscope.core.model.GenerateOptions options, String cacheTtl) Apply tools to the message create params builder with an optional cache TTL.
-
Constructor Details
-
AnthropicToolsHelper
public AnthropicToolsHelper()
-
-
Method Details
-
applyTools
public static void applyTools(com.anthropic.models.messages.MessageCreateParams.Builder builder, List<io.agentscope.core.model.ToolSchema> tools, io.agentscope.core.model.GenerateOptions options) Apply tools to the message create params builder.- Parameters:
builder- The message create params buildertools- List of tool schemasoptions- Generate options containing tool choice
-
applyTools
public static void applyTools(com.anthropic.models.messages.MessageCreateParams.Builder builder, List<io.agentscope.core.model.ToolSchema> tools, io.agentscope.core.model.GenerateOptions options, String cacheTtl) Apply tools to the message create params builder with an optional cache TTL.- Parameters:
builder- The message create params buildertools- List of tool schemasoptions- Generate options containing tool choicecacheTtl- TTL for ephemeral cache control (null/empty for default 5m)
-
applyOptions
public static void applyOptions(com.anthropic.models.messages.MessageCreateParams.Builder builder, io.agentscope.core.model.GenerateOptions options, io.agentscope.core.model.GenerateOptions defaultOptions) Apply generation options to the builder.- Parameters:
builder- The message create params builderoptions- Generate optionsdefaultOptions- Default generate options
-