Class LocalSkillSource
- All Implemented Interfaces:
SkillSource
Loads skills from the local file system.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractSkillSource
AbstractSkillSource.SkillMdPathModifier and TypeClassDescriptionprotected final classA container class that holds a skill's name and the path to its SKILL.md file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected io.reactivex.rxjava3.core.Single<Path> findResourcePath(String skillName, String resourcePath) Returns the path to the resource for the given skill.protected io.reactivex.rxjava3.core.Single<Path> findSkillMdPath(String skillName) Returns the path to the SKILL.md file for the given skill.io.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableList<String>> listResources(String skillName, String resourceDirectory) Lists all resource files for a specific skill within a given directory.protected io.reactivex.rxjava3.core.Flowable<AbstractSkillSource<Path>.SkillMdPath> Returns aFlowableof skills as a pair of skill name and the path to the SKILL.md file.protected ReadableByteChannelopenChannel(Path path) Opens aInputStreamfor reading the content of the given path.Methods inherited from class AbstractSkillSource
listFrontmatters, loadFrontmatter, loadInstructions, loadResourceModifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableMap<String, Frontmatter>> Lists all availableFrontmatters for discovered skills.io.reactivex.rxjava3.core.Single<Frontmatter> loadFrontmatter(String skillName) Loads theFrontmatterfor a specific skill.io.reactivex.rxjava3.core.Single<String> loadInstructions(String skillName) Loads the instructions (body of SKILL.md) for a specific skill.io.reactivex.rxjava3.core.Single<com.google.common.io.ByteSource> loadResource(String skillName, String resourcePath) Loads a specific resource file content.
-
Constructor Details
-
LocalSkillSource
-
-
Method Details
-
listResources
public io.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableList<String>> listResources(String skillName, String resourceDirectory) Description copied from interface:SkillSourceLists all resource files for a specific skill within a given directory.If the skill or the resource directory does not exist, the returned
Singlewill terminate with aSkillSourceException.- Parameters:
skillName- the name of the skillresourceDirectory- the relative directory within the skill to list (e.g., "assets", "scripts")- Returns:
- a
Singleemitting a list of resource paths relative to the skill directory
-
listSkills
Description copied from class:AbstractSkillSourceReturns aFlowableof skills as a pair of skill name and the path to the SKILL.md file.- Specified by:
listSkillsin classAbstractSkillSource<Path>
-
findResourcePath
protected io.reactivex.rxjava3.core.Single<Path> findResourcePath(String skillName, String resourcePath) Description copied from class:AbstractSkillSourceReturns the path to the resource for the given skill.- Specified by:
findResourcePathin classAbstractSkillSource<Path>
-
findSkillMdPath
Description copied from class:AbstractSkillSourceReturns the path to the SKILL.md file for the given skill.- Specified by:
findSkillMdPathin classAbstractSkillSource<Path>
-
openChannel
Description copied from class:AbstractSkillSourceOpens aInputStreamfor reading the content of the given path.- Specified by:
openChannelin classAbstractSkillSource<Path>- Throws:
IOException
-