Builder
public static final class Builder
源码Source
io/agentscope/core/tool/ToolBase.java:313–386构建器,用于构建并配置目标实例。位于 io.agentscope.core.tool 包。核心成员包括 name、description、inputSchema、readOnly、concurrencySafe、externalTool。
Fluent builder for ToolBase subclasses.
方法摘要Method Summary
方法详情Method Detail
name
public Builder name(String name)
设置名称。
Performs the name operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:329–332description
public Builder description(String description)
设置该配置项。
Performs the description operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
description | String | 描述(类型 `String`)。The description. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:334–337inputSchema
public Builder inputSchema(Map<String, Object> inputSchema)
设置输入模式。
Performs the input schema operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
inputSchema | Map<String, Object> | 输入模式(类型 `Map`)。The input schema. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:339–342readOnly
public Builder readOnly(boolean readOnly)
设置该配置项。
Performs the read only operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
readOnly | boolean | 读取 Only(类型 `boolean`)。The read only. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:344–347concurrencySafe
public Builder concurrencySafe(boolean concurrencySafe)
设置该配置项。
Performs the concurrency safe operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
concurrencySafe | boolean | concurrency 安全(类型 `boolean`)。The concurrency safe. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:349–352externalTool
public Builder externalTool(boolean externalTool)
设置外部工具。
Performs the external tool operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
externalTool | boolean | 外部工具(类型 `boolean`)。The external tool. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:354–357stateInjected
public Builder stateInjected(boolean stateInjected)
设置该配置项。
Performs the state injected operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
stateInjected | boolean | 状态 Injected(类型 `boolean`)。The state injected. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:359–362returnDirect
public Builder returnDirect(boolean returnDirect)
设置该配置项。
Sets whether this tool's result should be returned directly to the caller.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
returnDirect | boolean | return Direct(类型 `boolean`)。The return direct. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:365–368mcp
public Builder mcp(String mcpName)
设置MCP。
Marks the tool as an MCP tool and records the MCP server name.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mcpName | String | MCP 名称(类型 `String`)。The mcp name. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:371–375dangerousFiles
public Builder dangerousFiles(List<String> dangerousFiles)
设置该配置项。
Performs the dangerous files operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
dangerousFiles | List<String> | dangerous 文件(类型 `List`)。The dangerous files. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:377–380dangerousDirectories
public Builder dangerousDirectories(List<String> dangerousDirectories)
设置该配置项。
Performs the dangerous directories operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
dangerousDirectories | List<String> | dangerous Directories(类型 `List`)。The dangerous directories. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/tool/ToolBase.java:382–385