类 ToolExecutionContext.Builder

java.lang.Object
io.agentscope.core.tool.ToolExecutionContext.Builder
封闭类:
ToolExecutionContext

public static class ToolExecutionContext.Builder extends Object
Builder for ToolExecutionContext.
  • 方法详细资料

    • register

      public ToolExecutionContext.Builder register(Object object)
      Registers an object by its runtime type (singleton pattern).
      参数:
      object - The object to register
      返回:
      This builder
    • register

      public <T> ToolExecutionContext.Builder register(Class<T> type, T object)
      Registers an object with explicit type (e.g., by interface).
      类型参数:
      T - The object type
      参数:
      type - The type key
      object - The object to register
      返回:
      This builder
    • register

      public <T> ToolExecutionContext.Builder register(String key, Class<T> type, T object)
      Registers an object with key and type (multi-instance pattern).
      类型参数:
      T - The object type
      参数:
      key - The key identifying this instance
      type - The type key
      object - The object to register
      返回:
      This builder
    • register

      public ToolExecutionContext.Builder register(String key, Object object)
      Registers an object with key (type inferred from runtime).
      参数:
      key - The key identifying this instance
      object - The object to register
      返回:
      This builder
    • addStore

      public ToolExecutionContext.Builder addStore(ContextStore store)
      Adds a single store to the store list.

      This allows adding custom ContextStore implementations.

      参数:
      store - The context store to add
      返回:
      This builder
    • build

      public ToolExecutionContext build()
      Builds the ToolExecutionContext.
      返回:
      A new ToolExecutionContext