Class AnthropicToolsHelper

java.lang.Object
io.agentscope.extensions.model.anthropic.formatter.AnthropicToolsHelper

public class AnthropicToolsHelper extends Object
Helper class for tool registration and option application for Anthropic API.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 builder
      tools - List of tool schemas
      options - 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 builder
      tools - List of tool schemas
      options - Generate options containing tool choice
      cacheTtl - 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 builder
      options - Generate options
      defaultOptions - Default generate options