Package com.google.adk.skills
Class LocalSkillSource
- All Implemented Interfaces:
SkillSource
Loads skills from the local file system.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.adk.skills.AbstractSkillSource
AbstractSkillSource.SkillMdPath -
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 com.google.adk.skills.AbstractSkillSource
listFrontmatters, loadFrontmatter, loadInstructions, loadResource
-
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
-