ToolRequestConfig
public record ToolRequestConfig( Map<String, SchemaOnlyTool> externalTools, ToolMergeMode mergeMode )
io/agentscope/core/tool/ToolRequestConfig.java:41–119承载工具请求配置数据的记录类型。位于 io.agentscope.core.tool 包。核心成员包括 externalTools、mergeMode、ToolRequestConfig、NONE。
Immutable per-call tool request config. Composed (NOT copied) with a shared, stateless Toolkit to produce the tool surface for one call. Never mutates nor copies the shared toolkit.
Produced by any external-tool-injection layer (AG-UI adapter today); #NONE means "use
the shared toolkit as-is". #externalTools() are SchemaOnlyTool instances — in
this framework an external tool is by definition schema-only (no local implementation), and
SchemaOnlyTool carries only a schema (no groupManager/registry back-reference),
so they are safe to construct per-call and carry in an immutable request config. The concrete
type (Map<String, SchemaOnlyTool> rather than Map<String, AgentTool>) makes
"external tool ⇒ schema-only" a compile-time invariant.
Contract: externalTools always take priority over the backend regardless of mergeMode — mergeMode only governs backend visibility (ToolMergeMode#EXTERNAL_ONLY hides the backend without changing the registry). AGENT_ONLY therefore only ever pairs with an empty tool map (that is #NONE); a
non-empty externalTools combined with AGENT_ONLY is rejected.
记录组件摘要Record Component Summary
| 组件Component | 类型Type | 说明Description |
|---|---|---|
externalTools | Map<String, SchemaOnlyTool> | 执行外部工具相关操作。 Performs the external tools operation. |
mergeMode | ToolMergeMode | 合并模式。 Performs the merge mode operation. |
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
NONEstaticfinal | ToolRequestConfig | NONE字段。 Sentinel meaning "use the shared toolkit as-is". |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public ToolRequestConfig(Map<String, SchemaOnlyTool> externalTools, ToolMergeMode mergeMode) | 初始化 `ToolRequestConfig` 实例。 Creates a new instance. |
记录组件详情Record Component Detail
externalTools
Map<String, SchemaOnlyTool> externalTools执行外部工具相关操作。
Performs the external tools operation.
io/agentscope/core/tool/ToolRequestConfig.java:41–119mergeMode
ToolMergeMode mergeMode合并模式。
Performs the merge mode operation.
io/agentscope/core/tool/ToolRequestConfig.java:41–119字段详情Field Detail
NONE
public static final ToolRequestConfig NONE
NONE字段。声明为 public static final ToolRequestConfig NONE。
Sentinel meaning "use the shared toolkit as-is".
io/agentscope/core/tool/ToolRequestConfig.java:49–50构造器详情Constructor Detail
ToolRequestConfig
public ToolRequestConfig(Map<String, SchemaOnlyTool> externalTools, ToolMergeMode mergeMode)
初始化 ToolRequestConfig 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
externalTools | Map<String, SchemaOnlyTool> | 外部工具(类型 `Map`)。The external tools. |
mergeMode | ToolMergeMode | merge 模式(类型 `ToolMergeMode`)。The merge mode. |
io/agentscope/core/tool/ToolRequestConfig.java:52–80