SkillResources
public interface SkillResources
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.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
relativePath | String | relative 路径(类型 `String`)。path relative to the skill root |
Optional<String>io/agentscope/harness/agent/skill/SkillResources.java:41readBinary
public Optional<byte[]> readBinary(String relativePath)
设置读取二元。
Reads a binary resource.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
relativePath | String | relative 路径(类型 `String`)。path relative to the skill root |
Optional<byte[]>io/agentscope/harness/agent/skill/SkillResources.java:49list
public List<String> list()
返回列表。
Lists all relative resource paths that this accessor can serve.
List<String>io/agentscope/harness/agent/skill/SkillResources.java:59empty
static public SkillResources empty()
返回 empty 结果。
Returns a no-op accessor that reports no resources.
SkillResourcesio/agentscope/harness/agent/skill/SkillResources.java:66–68