类 FileSystemSkillRepository
java.lang.Object
io.agentscope.core.skill.repository.FileSystemSkillRepository
- 所有已实现的接口:
AgentSkillRepository,AutoCloseable
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");
-
构造器概要
构造器构造器说明FileSystemSkillRepository(Path baseDir) FileSystemSkillRepository(Path baseDir, boolean writeable) Creates a FileSystemSkillRepository with the specified base directory.FileSystemSkillRepository(Path baseDir, boolean writeable, String source) Creates a FileSystemSkillRepository with the specified base directory and source. -
方法概要
修饰符和类型方法说明booleanDeletes a skill by its skill name.Lists all available skill IDs in the repository.Gets all skills from the repository.Gets metadata about this repository.Gets a skill by its name.Gets the source identifier of this repository.booleanChecks if the repository supports write operations.booleansave(List<AgentSkill> skills, boolean force) Saves or updates a skill in the repository.voidsetWriteable(boolean writeable) Sets the writeable flag for this repository.booleanskillExists(String skillName) Checks if a skill exists in the repository.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 io.agentscope.core.skill.repository.AgentSkillRepository
close
-
构造器详细资料
-
FileSystemSkillRepository
-
FileSystemSkillRepository
Creates a FileSystemSkillRepository with the specified base directory.- 参数:
baseDir- The base directory containing skill subdirectories (must not be null)writeable- Whether the repository supports write operations- 抛出:
IllegalArgumentException- if baseDir is null, doesn't exist, is not a directory, or is empty
-
FileSystemSkillRepository
Creates a FileSystemSkillRepository with the specified base directory and source.- 参数:
baseDir- The base directory containing skill subdirectories (must not be null)writeable- Whether the repository supports write operationssource- The custom source identifier for skills (null to use default)- 抛出:
IllegalArgumentException- if baseDir is null, doesn't exist, is not a directory, or is empty
-
-
方法详细资料
-
getSkill
从接口复制的说明:AgentSkillRepositoryGets a skill by its name.- 指定者:
getSkill在接口中AgentSkillRepository- 参数:
name- The skill name- 返回:
- The skill matching the name
-
getAllSkillNames
从接口复制的说明:AgentSkillRepositoryLists all available skill IDs in the repository.Each skill ID follows the format
name_version_source.- 指定者:
getAllSkillNames在接口中AgentSkillRepository- 返回:
- List of all skill IDs (never null, may be empty)
-
getAllSkills
从接口复制的说明:AgentSkillRepositoryGets all skills from the repository.- 指定者:
getAllSkills在接口中AgentSkillRepository- 返回:
- List of all skills (never null, may be empty)
-
save
从接口复制的说明:AgentSkillRepositorySaves or updates a skill in the repository.If a skill with the same name exists, it will be updated. Otherwise, a new skill will be created.
If the skills list is empty, return false.
- 指定者:
save在接口中AgentSkillRepository- 参数:
skills- The skills to saveforce- Whether to force save even if the skill already exists- 返回:
trueif save succeeded,falseotherwise
-
delete
从接口复制的说明:AgentSkillRepositoryDeletes a skill by its skill name.- 指定者:
delete在接口中AgentSkillRepository- 参数:
skillName- The skill name (never null)- 返回:
trueif deletion succeeded,falseif skill not found
-
skillExists
从接口复制的说明:AgentSkillRepositoryChecks if a skill exists in the repository.- 指定者:
skillExists在接口中AgentSkillRepository- 参数:
skillName- The skill name (never null)- 返回:
trueif the skill exists,falseotherwise
-
getRepositoryInfo
从接口复制的说明:AgentSkillRepositoryGets metadata about this repository.The information includes repository type, location, and other metadata.
- 指定者:
getRepositoryInfo在接口中AgentSkillRepository- 返回:
- Repository information (never null)
-
getSource
从接口复制的说明:AgentSkillRepositoryGets the source identifier of this repository.The source follows the format
repositoryType_location.- 指定者:
getSource在接口中AgentSkillRepository- 返回:
- The source identifier (never null)
-
setWriteable
public void setWriteable(boolean writeable) 从接口复制的说明:AgentSkillRepositorySets the writeable flag for this repository.- 指定者:
setWriteable在接口中AgentSkillRepository- 参数:
writeable- Whether the repository supports write operations
-
isWriteable
public boolean isWriteable()从接口复制的说明:AgentSkillRepositoryChecks if the repository supports write operations.- 指定者:
isWriteable在接口中AgentSkillRepository- 返回:
trueif writable,falseotherwise
-