AS AgentScopeAPI 手册 / API Reference

ToolkitConfig

public class ToolkitConfig
源码Source io/agentscope/core/tool/ToolkitConfig.java:33–205

用于工具包执行行为的配置。位于 io.agentscope.core.tool 包。核心成员包括 isParallel、getExecutorService、hasCustomExecutor、getExecutionConfig、isAllowToolDeletion、getDefaultContext。

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, multiple tool calls in one turn run in parallel on Reactor's Schedulers. The default execution config provides 5-minute timeout with no retry (1 attempt). Pass parallel(false) to serialize tool execution.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
ToolkitConfig的构建器。
Builder for ToolkitConfig.

方法摘要Method Summary

方法Method说明Description
public boolean isParallel()
判断是否 `isParallel`。
Whether tools should be executed in parallel.
public ExecutorService getExecutorService()
获取执行器服务。
Get the custom executor service if provided.
public boolean hasCustomExecutor()
判断是否具有自定义执行器。
Check if a custom executor service was provided.
public ExecutionConfig getExecutionConfig()
获取执行配置用于超时和重试。
Get the execution configuration for timeout and retry.
public boolean isAllowToolDeletion()
判断是否 `isAllowToolDeletion`。
Check if tool deletion is allowed.
public ToolExecutionContext getDefaultContext()
deprecated
获取默认工具执行上下文。
Get the default tool execution context.
public static Builder builder()
static
创建用于ToolkitConfig的构建器。
Create a new builder for ToolkitConfig.
public static ToolkitConfig defaultConfig()
static
返回默认配置。
Get the default configuration (parallel execution using Reactor).

方法详情Method Detail

isParallel

public boolean isParallel()

判断是否 isParallel。

Whether tools should be executed in parallel.

返回Returns boolean
返回布尔值,表示判断结果。true if parallel execution is enabled
源码Source io/agentscope/core/tool/ToolkitConfig.java:54–56

getExecutorService

public ExecutorService getExecutorService()

获取执行器服务。

Get the custom executor service if provided.

返回Returns ExecutorService
返回ExecutorService。ExecutorService or null if using default Reactor schedulers
源码Source io/agentscope/core/tool/ToolkitConfig.java:63–65

hasCustomExecutor

public boolean hasCustomExecutor()

判断是否具有自定义执行器。

Check if a custom executor service was provided.

返回Returns boolean
返回布尔值,表示判断结果。true if custom executor is configured
源码Source io/agentscope/core/tool/ToolkitConfig.java:72–74

getExecutionConfig

public ExecutionConfig getExecutionConfig()

获取执行配置用于超时和重试。

Get the execution configuration for timeout and retry.

返回Returns ExecutionConfig
返回ExecutionConfig。ExecutionConfig or null if not configured (defaults will be applied)
源码Source io/agentscope/core/tool/ToolkitConfig.java:81–83

isAllowToolDeletion

public boolean isAllowToolDeletion()

判断是否 isAllowToolDeletion。

Check if tool deletion is allowed.

返回Returns boolean
返回布尔值,表示判断结果。true if tool deletion is allowed (default), false otherwise
源码Source io/agentscope/core/tool/ToolkitConfig.java:90–92

getDefaultContext

public ToolExecutionContext getDefaultContext()
deprecated

获取默认工具执行上下文。

Get the default tool execution context.

已弃用。Deprecated. 已弃用,请改用受支持的替代 API。Use `io.agentscope.core.agent.RuntimeContext` instead.
返回Returns ToolExecutionContext
返回ToolExecutionContext。The default context, or null if not configured
源码Source io/agentscope/core/tool/ToolkitConfig.java:100–103

builder

public static Builder builder()
static

创建用于ToolkitConfig的构建器。

Create a new builder for ToolkitConfig.

返回Returns Builder
返回当前实例,以支持链式调用。Builder instance
源码Source io/agentscope/core/tool/ToolkitConfig.java:110–112

defaultConfig

public static ToolkitConfig defaultConfig()
static

返回默认配置。

Get the default configuration (parallel execution using Reactor).

返回Returns ToolkitConfig
返回ToolkitConfig。Default ToolkitConfig
源码Source io/agentscope/core/tool/ToolkitConfig.java:119–121

嵌套类详情Nested Class Detail

Builder

public static class Builder

ToolkitConfig的构建器。位于 io.agentscope.core.tool 包。核心成员包括 parallel、executorService、executionConfig、allowToolDeletion、defaultContext、build。

Builder for ToolkitConfig.

基于官方固定版本源码静态生成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.