AS AgentScopeAPI 手册 / API Reference

SkillLoadTool

@SuppressWarnings("deprecation") public final class SkillLoadTool implements AgentTool
源码Source io/agentscope/harness/agent/skill/runtime/SkillLoadTool.java:54–317

技能加载工具,封装可被智能体调用的能力。位于 io.agentscope.harness.agent.skill.runtime 包,实现 AgentTool。核心成员包括 isReadOnly、getName、getDescription、getParameters、callAsync、SkillLoadTool。

The harness-native load_skill_through_path AgentTool.

Query order for any path other than SKILL.md:

  • skill.getResources().get(path) — in-memory map (Layer 1/3 host repositories and marketplace repositories that preload everything)

  • entry.lazyResources().read(path) — filesystem fallback for sources that implement io.agentscope.harness.agent.skill.LazyResourceCapable (e.g. WorkspaceSkillRepository)

  • Not found → error with a deduped enumeration of SKILL.md + in-memory keys + lazy listing

The registered tool resolves the filtered catalog from each tool call's RuntimeContext (ToolCallParam#getRuntimeContext()), keeping concurrent calls and sessions isolated without re-registering the tool. A legacy catalog reference is consulted only for deprecated callers that invoke the tool without any RuntimeContext.

字段摘要Field Summary

字段Field类型Type说明Description
TOOL_NAME
staticfinal
String
工具名称字段。
The TOOL NAME field.

构造器摘要Constructor Summary

构造器Constructor说明Description
public SkillLoadTool()
初始化 `SkillLoadTool` 实例。
Creates a context-scoped loader with an empty context-free compatibility catalog.
public SkillLoadTool(AtomicReference<SkillCatalog> catalogRef)
deprecated
初始化 `SkillLoadTool` 实例。
Creates a loader backed by a legacy context-free catalog reference.

方法摘要Method Summary

方法Method说明Description
public boolean isReadOnly()
判断是否 `isReadOnly`。
Returns whether the read only.
public String getName()
获取名称。
Returns the name.
public String getDescription()
获取 `getDescription`。
Returns the description.
public Map<String, Object> getParameters()
获取参数。
Returns the parameters.
public Mono<ToolResultBlock> callAsync(ToolCallParam param)
调用异步。
Calls the async.

字段详情Field Detail

TOOL_NAME

public static final String TOOL_NAME
staticfinal

工具名称字段。声明为 public static final String TOOL_NAME。

The TOOL NAME field.

源码Source io/agentscope/harness/agent/skill/runtime/SkillLoadTool.java:57

构造器详情Constructor Detail

SkillLoadTool

public SkillLoadTool()

初始化 SkillLoadTool 实例。

Creates a context-scoped loader with an empty context-free compatibility catalog.

源码Source io/agentscope/harness/agent/skill/runtime/SkillLoadTool.java:66–68

SkillLoadTool

public SkillLoadTool(AtomicReference<SkillCatalog> catalogRef)
deprecated

初始化 SkillLoadTool 实例。

Creates a loader backed by a legacy context-free catalog reference.

已弃用。Deprecated. 已弃用,请改用受支持的替代 API。Prefer `#SkillLoadTool()` and bind catalogs through `SkillRuntime#install(SkillCatalog, io.agentscope.core.agent.RuntimeContext, io.agentscope.core.tool.Toolkit)`.
参数Parameters
名称Name类型Type说明Description
catalogRefAtomicReference<SkillCatalog>目录引用(类型 `AtomicReference`)。The catalog ref.
源码Source io/agentscope/harness/agent/skill/runtime/SkillLoadTool.java:81–84

方法详情Method Detail

isReadOnly

public boolean isReadOnly()

判断是否 isReadOnly。

Returns whether the read only.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/skill/runtime/SkillLoadTool.java:95–98

getName

public String getName()

获取名称。

Returns the name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/skill/runtime/SkillLoadTool.java:100–103

getDescription

public String getDescription()

获取 getDescription。

Returns the description.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/skill/runtime/SkillLoadTool.java:105–114

getParameters

public Map<String, Object> getParameters()

获取参数。

Returns the parameters.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/harness/agent/skill/runtime/SkillLoadTool.java:116–153

callAsync

public Mono<ToolResultBlock> callAsync(ToolCallParam param)

调用异步。

Calls the async.

参数Parameters
名称Name类型Type说明Description
paramToolCallParam参数(类型 `ToolCallParam`)。The param.
返回Returns Mono<ToolResultBlock>
返回Mono。Returns mono.
源码Source io/agentscope/harness/agent/skill/runtime/SkillLoadTool.java:155–185

继承成员Inherited Members

继承自Methods inherited from AgentTool
基于官方固定版本源码静态生成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.