pub struct SkillSet { /* private fields */ }Expand description
A collection of loaded skills.
Implementations§
Source§impl SkillSet
impl SkillSet
Sourcepub fn load(dirs: &[impl AsRef<Path>]) -> Result<Self, SkillError>
pub fn load(dirs: &[impl AsRef<Path>]) -> Result<Self, SkillError>
Load skills from multiple directories. Later directories take precedence (skills with the same name from later dirs override earlier ones).
Sourcepub fn load_dir(dir: impl AsRef<Path>, source: &str) -> Result<Self, SkillError>
pub fn load_dir(dir: impl AsRef<Path>, source: &str) -> Result<Self, SkillError>
Load skills from a single directory with a custom source label.
Sourcepub fn merge(&mut self, other: SkillSet)
pub fn merge(&mut self, other: SkillSet)
Merge another skill set into this one. Other’s skills override on name conflict.
Sourcepub fn format_for_prompt(&self) -> String
pub fn format_for_prompt(&self) -> String
Format skills for inclusion in a system prompt.
Uses XML format per the AgentSkills standard:
<available_skills>
<skill>
<name>weather</name>
<description>Get current weather and forecasts.</description>
<location>/path/to/skills/weather/SKILL.md</location>
</skill>
</available_skills>Returns an empty string if no skills are loaded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SkillSet
impl RefUnwindSafe for SkillSet
impl Send for SkillSet
impl Sync for SkillSet
impl Unpin for SkillSet
impl UnsafeUnpin for SkillSet
impl UnwindSafe for SkillSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more