AS AgentScopeAPI 手册 / API Reference

FileSystemSkillRepository

public class FileSystemSkillRepository implements AgentSkillRepository
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:60–292

文件系统技能仓库,负责持久化与读取数据。位于 io.agentscope.core.skill.repository 包,实现 AgentSkillRepository。核心成员包括 isLazy、getSkill、getAllSkillNames、getAllSkills、save、delete。

File system based implementation of AgentSkillRepository.

This repository stores skills in a local file system directory structure where each skill is stored in its own subdirectory containing a SKILL.md file and optional resource files.

Directory structure:

`baseDir/
├── skill-name-1/
│ ├── SKILL.md # Required: Entry file with YAML frontmatter
│ ├── references/ # Optional: Reference documentation
│ ├── examples/ # Optional: Example files
│ └── scripts/ # Optional: Script files
└── skill-name-2/
└── SKILL.md
`

Example usage:

`Path baseDir = Paths.get("/path/to/skills");
FileSystemSkillRepository repo = new FileSystemSkillRepository(baseDir);
AgentSkill skill = repo.getSkill("my-skill");
`

构造器摘要Constructor Summary

构造器Constructor说明Description
public FileSystemSkillRepository(Path baseDir)
初始化 `FileSystemSkillRepository` 实例。
Creates a new instance.
public FileSystemSkillRepository(Path baseDir, boolean writeable)
初始化 `FileSystemSkillRepository` 实例。
Creates a FileSystemSkillRepository with the specified base directory.
public FileSystemSkillRepository(Path baseDir, boolean writeable, String source)
初始化 `FileSystemSkillRepository` 实例。
Creates a FileSystemSkillRepository with the specified base directory and source.
public FileSystemSkillRepository(Path baseDir, boolean writeable, String source, boolean lazy)
初始化 `FileSystemSkillRepository` 实例。
Creates a FileSystemSkillRepository with explicit lazy mode.

方法摘要Method Summary

方法Method说明Description
public boolean isLazy()
判断是否 `isLazy`。
Whether this repository only reads SKILL.md and defers support-file loading.
public AgentSkill getSkill(String name)
获取技能。
Returns the skill.
public List<String> getAllSkillNames()
获取 `getAllSkillNames`。
Returns the all skill names.
public List<AgentSkill> getAllSkills()
获取所有技能。
Returns the all skills.
public boolean save(List<AgentSkill> skills, boolean force)
保存数据到持久化存储。
Performs the save operation.
public boolean delete(String skillName)
删除数据。
Performs the delete operation.
public boolean skillExists(String skillName)
设置该参数。
Performs the skill exists operation.
public AgentSkillRepositoryInfo getRepositoryInfo()
获取仓库信息。
Returns the repository info.
public String getSource()
获取来源。
Returns the source.
public void setWriteable(boolean writeable)
设置 `setWriteable`。
Sets the writeable.
public boolean isWriteable()
判断是否 `isWriteable`。
Returns whether the writeable.

构造器详情Constructor Detail

FileSystemSkillRepository

public FileSystemSkillRepository(Path baseDir)

初始化 FileSystemSkillRepository 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
baseDirPath基类目录(类型 `Path`)。The base dir.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:83–85

FileSystemSkillRepository

public FileSystemSkillRepository(Path baseDir, boolean writeable)

初始化 FileSystemSkillRepository 实例。

Creates a FileSystemSkillRepository with the specified base directory.

参数Parameters
名称Name类型Type说明Description
baseDirPath基类目录(类型 `Path`)。The base directory containing skill subdirectories (must not be null)
writeablebooleanwriteable(类型 `boolean`)。Whether the repository supports write operations
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if baseDir is null, doesn't exist, is not a directory, or is empty
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:95–97

FileSystemSkillRepository

public FileSystemSkillRepository(Path baseDir, boolean writeable, String source)

初始化 FileSystemSkillRepository 实例。

Creates a FileSystemSkillRepository with the specified base directory and source.

参数Parameters
名称Name类型Type说明Description
baseDirPath基类目录(类型 `Path`)。The base directory containing skill subdirectories (must not be null)
writeablebooleanwriteable(类型 `boolean`)。Whether the repository supports write operations
sourceString来源(类型 `String`)。The custom source identifier for skills (null to use default)
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if baseDir is null, doesn't exist, is not a directory, or is empty
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:108–110

FileSystemSkillRepository

public FileSystemSkillRepository(Path baseDir, boolean writeable, String source, boolean lazy)

初始化 FileSystemSkillRepository 实例。

Creates a FileSystemSkillRepository with explicit lazy mode.

参数Parameters
名称Name类型Type说明Description
baseDirPath基类目录(类型 `Path`)。The base directory containing skill subdirectories (must not be null)
writeablebooleanwriteable(类型 `boolean`)。Whether the repository supports write operations
sourceString来源(类型 `String`)。The custom source identifier for skills (null to use default)
lazybooleanlazy(类型 `boolean`)。when `true`, support files are NOT pre-loaded; consumers must resolve them via the skill's `originDir`. Use this together with a `load_skill_through_path` disk-fallback for large skill libraries
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if baseDir is null, doesn't exist, is not a directory, or is empty
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:124–148

方法详情Method Detail

isLazy

public boolean isLazy()

判断是否 isLazy。

Whether this repository only reads SKILL.md and defers support-file loading.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:151–153

getSkill

public AgentSkill getSkill(String name)

获取技能。

Returns the skill.

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。The name.
返回Returns AgentSkill
返回AgentSkill。Returns agent skill.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:155–171

getAllSkillNames

public List<String> getAllSkillNames()

获取 getAllSkillNames。

Returns the all skill names.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:173–176

getAllSkills

public List<AgentSkill> getAllSkills()

获取所有技能。

Returns the all skills.

返回Returns List<AgentSkill>
返回列出。Returns list.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:178–220

save

public boolean save(List<AgentSkill> skills, boolean force)

保存数据到持久化存储。

Performs the save operation.

参数Parameters
名称Name类型Type说明Description
skillsList<AgentSkill>技能(类型 `List`)。The skills.
forcebooleanforce(类型 `boolean`)。The force.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:225–239

delete

public boolean delete(String skillName)

删除数据。

Performs the delete operation.

参数Parameters
名称Name类型Type说明Description
skillNameString技能名称(类型 `String`)。The skill name.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:241–251

skillExists

public boolean skillExists(String skillName)

设置该参数。

Performs the skill exists operation.

参数Parameters
名称Name类型Type说明Description
skillNameString技能名称(类型 `String`)。The skill name.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:253–256

getRepositoryInfo

public AgentSkillRepositoryInfo getRepositoryInfo()

获取仓库信息。

Returns the repository info.

返回Returns AgentSkillRepositoryInfo
返回AgentSkillRepositoryInfo。Returns agent skill repository info.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:258–261

getSource

public String getSource()

获取来源。

Returns the source.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:263–266

setWriteable

public void setWriteable(boolean writeable)

设置 setWriteable。

Sets the writeable.

参数Parameters
名称Name类型Type说明Description
writeablebooleanwriteable(类型 `boolean`)。The writeable.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:283–286

isWriteable

public boolean isWriteable()

判断是否 isWriteable。

Returns whether the writeable.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/skill/repository/FileSystemSkillRepository.java:288–291

继承成员Inherited Members

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