AS AgentScopeAPI 手册 / API Reference

SkillResources

public interface SkillResources
源码Source io/agentscope/harness/agent/skill/SkillResources.java:33–69

定义技能 Resources契约的接口。位于 io.agentscope.harness.agent.skill 包。核心成员包括 read、readBinary、list、empty。

Lazy resource accessor for a single skill.

Decouples "what resources exist" from "how to fetch their contents", so that repositories backed by an AbstractFilesystem can answer load_skill_through_path calls on demand without preloading every byte of every skill into memory at registration time.

All paths are relative to the skill root (e.g. "references/guide.md", "scripts/run.py"). Absolute paths and path traversal sequences ("..") are rejected by implementations.

方法摘要Method Summary

方法Method说明Description
public Optional<String> read(String relativePath)
设置读取。
Reads a text resource as UTF-8.
public Optional<byte[]> readBinary(String relativePath)
设置读取二元。
Reads a binary resource.
public List<String> list()
返回列表。
Lists all relative resource paths that this accessor can serve.
static public SkillResources empty()
static
返回 `empty` 结果。
Returns a no-op accessor that reports no resources.

方法详情Method Detail

read

public Optional<String> read(String relativePath)

设置读取。

Reads a text resource as UTF-8.

参数Parameters
名称Name类型Type说明Description
relativePathStringrelative 路径(类型 `String`)。path relative to the skill root
返回Returns Optional<String>
返回可选。content, or empty if the resource does not exist or read fails
源码Source io/agentscope/harness/agent/skill/SkillResources.java:41

readBinary

public Optional<byte[]> readBinary(String relativePath)

设置读取二元。

Reads a binary resource.

参数Parameters
名称Name类型Type说明Description
relativePathStringrelative 路径(类型 `String`)。path relative to the skill root
返回Returns Optional<byte[]>
返回可选。content, or empty if the resource does not exist or read fails
源码Source io/agentscope/harness/agent/skill/SkillResources.java:49

list

public List<String> list()

返回列表。

Lists all relative resource paths that this accessor can serve.

返回Returns List<String>
返回列出。unmodifiable list of relative paths; never `null`
源码Source io/agentscope/harness/agent/skill/SkillResources.java:59

empty

static public SkillResources empty()
static

返回 empty 结果。

Returns a no-op accessor that reports no resources.

返回Returns SkillResources
返回SkillResources。shared empty instance
源码Source io/agentscope/harness/agent/skill/SkillResources.java:66–68
基于官方固定版本源码静态生成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.