pub struct UseSkillTool { /* private fields */ }Expand description
ToolExecutor that lazily fetches a named skill’s full Markdown body.
Why: Keeps the LLM-facing surface (name(), schema(), execute())
independent of which SkillResolver implementation backs it.
What: Delegates every call to the wrapped resolver’s resolve().
Test: use_skill_resolves_known_skill.
Implementations§
Source§impl UseSkillTool
impl UseSkillTool
Sourcepub fn new(resolver: Arc<dyn SkillResolver>) -> Self
pub fn new(resolver: Arc<dyn SkillResolver>) -> Self
Construct a UseSkillTool backed by resolver.
Why: Constructor injection keeps the tool testable with a stub
resolver, matching every other ToolExecutor in this crate.
What: Stores the Arc<dyn SkillResolver> for use in execute.
Test: use_skill_resolves_known_skill.
Trait Implementations§
Source§impl ToolExecutor for UseSkillTool
impl ToolExecutor for UseSkillTool
Source§fn schema(&self) -> Value
fn schema(&self) -> Value
OpenAI function-call schema for use_skill.
Why: The LLM needs the skill name field to make the call; the
description points back at the catalog the prompt already injected.
Test: use_skill_schema_has_required_name.
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a use_skill tool call.
Why: This is the moment progressive disclosure actually defers to —
the body is read from disk only now, not at prompt-assembly time.
What: Parses {name} from args, calls resolver.resolve(name), and
converts the result into a ToolResult.
Test: use_skill_resolves_known_skill, use_skill_errors_on_unknown,
use_skill_errors_on_missing_name.
Source§fn restricted_tiers(&self) -> &[ServiceTier]
fn restricted_tiers(&self) -> &[ServiceTier]
Auto Trait Implementations§
impl !RefUnwindSafe for UseSkillTool
impl !UnwindSafe for UseSkillTool
impl Freeze for UseSkillTool
impl Send for UseSkillTool
impl Sync for UseSkillTool
impl Unpin for UseSkillTool
impl UnsafeUnpin for UseSkillTool
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more