类 ToolkitConfig

java.lang.Object
io.agentscope.core.tool.ToolkitConfig

public class ToolkitConfig extends Object
Configuration for Toolkit execution behavior.

This class defines how tools are executed: - Parallel vs Sequential execution - Custom ExecutorService (optional) - Execution configuration for timeout and retry

By default, all tool execution is asynchronous using Reactor's Schedulers. The default execution config provides 5-minute timeout with no retry (1 attempt).

  • 方法详细资料

    • isParallel

      public boolean isParallel()
      Whether tools should be executed in parallel.
      返回:
      true if parallel execution is enabled
    • getExecutorService

      public ExecutorService getExecutorService()
      Get the custom executor service if provided.
      返回:
      ExecutorService or null if using default Reactor schedulers
    • hasCustomExecutor

      public boolean hasCustomExecutor()
      Check if a custom executor service was provided.
      返回:
      true if custom executor is configured
    • getExecutionConfig

      public ExecutionConfig getExecutionConfig()
      Get the execution configuration for timeout and retry.
      返回:
      ExecutionConfig or null if not configured (defaults will be applied)
    • isAllowToolDeletion

      public boolean isAllowToolDeletion()
      Check if tool deletion is allowed.
      返回:
      true if tool deletion is allowed (default), false otherwise
    • getDefaultContext

      public ToolExecutionContext getDefaultContext()
      Get the default tool execution context.

      This context is used as the base for all tool calls and can be overridden by agent-level or call-level contexts.

      返回:
      The default context, or null if not configured
    • builder

      public static ToolkitConfig.Builder builder()
      Create a new builder for ToolkitConfig.
      返回:
      Builder instance
    • defaultConfig

      public static ToolkitConfig defaultConfig()
      Get the default configuration (sequential execution using Reactor).
      返回:
      Default ToolkitConfig