AS AgentScopeAPI 手册 / API Reference

LazyResourceCapable

public interface LazyResourceCapable
源码Source io/agentscope/harness/agent/skill/LazyResourceCapable.java:36–52

定义 Lazy 资源 Capable契约的接口。位于 io.agentscope.harness.agent.skill 包。核心成员包括 resourcesFor。

Optional marker for io.agentscope.core.skill.repository.AgentSkillRepository implementations that can supply a SkillResources accessor in addition to the in-memory AgentSkill.resources map.

Detected via instanceof by the harness skill runtime: if a repository implements this interface, the runtime will request a SkillResources per skill and consult it as a fallback when load_skill_through_path misses the in-memory map. This is what lets WorkspaceSkillRepository keep skills lazy on disk (or in sandbox) without preloading every byte at registration time.

Repositories that preload all resources into AgentSkill.resources (e.g. core's FileSystemSkillRepository, ClasspathSkillRepository, and most third-party marketplace extensions) do not need to implement this — the in-memory map already covers every path.

方法摘要Method Summary

方法Method说明Description
public SkillResources resourcesFor(String skillName, RuntimeContext ctx)
执行 `resourcesFor` 方法。
Returns a lazy resource accessor for the named skill.

方法详情Method Detail

resourcesFor

public SkillResources resourcesFor(String skillName, RuntimeContext ctx)

执行 resourcesFor 方法。

Returns a lazy resource accessor for the named skill.

参数Parameters
名称Name类型Type说明Description
skillNameString技能's`name`(不`skillId`)。the skill's `name` (not `skillId`)
ctxRuntimeContext运行时上下文(类型 `RuntimeContext`)。current runtime context; never `null` (callers pass `RuntimeContext#empty()` when no context is available)
返回Returns SkillResources
返回SkillResources。accessor for that skill's resource tree, never `null` (return `SkillResources#empty()` if the skill does not belong to this repository)
源码Source io/agentscope/harness/agent/skill/LazyResourceCapable.java:51
基于官方固定版本源码静态生成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.