ToolsConfigLoader
public final class ToolsConfigLoader
源码Source
io/agentscope/harness/agent/tools/ToolsConfigLoader.java:41–117工具配置加载器,让智能体以受控方式调用外部能力。位于 io.agentscope.harness.agent.tools 包。核心成员包括 load。
Loads workspace/tools.json into a ToolsConfig.
Reads through WorkspaceManager#readManagedWorkspaceFileUtf8 so that the
filesystem-overlay (sandbox / remote) path is honoured exactly like AGENTS.md. Performs
${ENV_VAR} substitution against System#getenv on the raw JSON text before
parsing so that secrets in headers, env entries, urls, etc. are kept out of the file. Parse
failures never throw — they log and return Optional#empty() so the agent still builds
with its default toolkit.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static Optional<ToolsConfig> load(WorkspaceManager wsManager)static | 从持久化存储恢复数据。 Reads `tools.json` relative to the workspace managed by `wsManager`. |
方法详情Method Detail
load
public static Optional<ToolsConfig> load(WorkspaceManager wsManager)
static
从持久化存储恢复数据。
Reads tools.json relative to the workspace managed by wsManager.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
wsManager | WorkspaceManager | ws 管理器(类型 `WorkspaceManager`)。The ws manager. |
Optional<ToolsConfig>返回可选。Returns optional.
源码Source
io/agentscope/harness/agent/tools/ToolsConfigLoader.java:57–89