AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/tool/ToolkitConfig.java:126–204

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

Builder for ToolkitConfig.

方法摘要Method Summary

方法Method说明Description
public Builder parallel(boolean parallel)
设置该配置项。
Set whether to execute tools in parallel.
public Builder executorService(ExecutorService executorService)
设置自定义执行器服务用于工具执行。
Set a custom executor service for tool execution.
public Builder executionConfig(ExecutionConfig executionConfig)
设置执行配置用于超时和重试行为。
Set the execution configuration for timeout and retry behavior.
public Builder allowToolDeletion(boolean allowToolDeletion)
设置该配置项。
Set whether tool deletion is allowed.
public Builder defaultContext(ToolExecutionContext defaultContext)
deprecated
设置默认工具执行上下文用于所有工具。
Set the default tool execution context for all tools.
public ToolkitConfig build()
构建ToolkitConfig。
Build the ToolkitConfig.

方法详情Method Detail

parallel

public Builder parallel(boolean parallel)

设置该配置项。

Set whether to execute tools in parallel.

参数Parameters
名称Name类型Type说明Description
parallelbooleanparallel(类型 `boolean`)。true for parallel execution, false for sequential
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/tool/ToolkitConfig.java:141–144

executorService

public Builder executorService(ExecutorService executorService)

设置自定义执行器服务用于工具执行。

Set a custom executor service for tool execution.

参数Parameters
名称Name类型Type说明Description
executorServiceExecutorService执行器服务(类型 `ExecutorService`)。Custom executor service
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/tool/ToolkitConfig.java:153–156

executionConfig

public Builder executionConfig(ExecutionConfig executionConfig)

设置执行配置用于超时和重试行为。

Set the execution configuration for timeout and retry behavior.

参数Parameters
名称Name类型Type说明Description
executionConfigExecutionConfig用于工具的执行配置。Execution configuration for tools
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/tool/ToolkitConfig.java:165–168

allowToolDeletion

public Builder allowToolDeletion(boolean allowToolDeletion)

设置该配置项。

Set whether tool deletion is allowed.

参数Parameters
名称Name类型Type说明Description
allowToolDeletionbooleanallow 工具 Deletion(类型 `boolean`)。true to allow deletion (default), false to prevent
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/tool/ToolkitConfig.java:178–181

defaultContext

public Builder defaultContext(ToolExecutionContext defaultContext)
deprecated

设置默认工具执行上下文用于所有工具。

Set the default tool execution context for all tools.

已弃用。Deprecated. 已弃用,请改用受支持的替代 API。Use `io.agentscope.core.agent.RuntimeContext` instead.
参数Parameters
名称Name类型Type说明Description
defaultContextToolExecutionContext默认执行上下文。The default execution context
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/tool/ToolkitConfig.java:190–194

build

public ToolkitConfig build()

构建ToolkitConfig。

Build the ToolkitConfig.

返回Returns ToolkitConfig
返回ToolkitConfig。Configured ToolkitConfig instance
源码Source io/agentscope/core/tool/ToolkitConfig.java:201–203
基于官方固定版本源码静态生成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.