AS AgentScopeAPI 手册 / API Reference

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
wsManagerWorkspaceManagerws 管理器(类型 `WorkspaceManager`)。The ws manager.
返回Returns Optional<ToolsConfig>
返回可选。Returns optional.
源码Source io/agentscope/harness/agent/tools/ToolsConfigLoader.java:57–89
基于官方固定版本源码静态生成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.