pub struct DefaultSkillExecutor<T, H = NoOpHooks> { /* private fields */ }Expand description
Default skill executor that uses a Transport to execute tool calls.
This executor implements the standard skill execution flow:
- Execute steps sequentially
- Apply timeout and retry logic per step
- Propagate outputs from earlier steps to later steps
- Invoke lifecycle hooks at appropriate points
§Type Parameters
T- The transport type for executing tool callsH- The hooks type for lifecycle callbacks (defaults toNoOpHooks)
§Example
ⓘ
use thulp_skills::{DefaultSkillExecutor, ExecutionContext, TracingHooks};
// With default no-op hooks
let executor = DefaultSkillExecutor::new(transport);
// With tracing hooks
let executor = DefaultSkillExecutor::with_hooks(transport, TracingHooks::new());
let mut context = ExecutionContext::new()
.with_input("query", json!("test"));
let result = executor.execute(&skill, &mut context).await?;Implementations§
Source§impl<T: Transport> DefaultSkillExecutor<T, NoOpHooks>
impl<T: Transport> DefaultSkillExecutor<T, NoOpHooks>
Source§impl<T: Transport, H: ExecutionHooks> DefaultSkillExecutor<T, H>
impl<T: Transport, H: ExecutionHooks> DefaultSkillExecutor<T, H>
Sourcepub fn with_hooks(transport: T, hooks: H) -> Self
pub fn with_hooks(transport: T, hooks: H) -> Self
Create a new executor with the given transport and hooks.
Trait Implementations§
Source§impl<T: Transport, H: ExecutionHooks> SkillExecutor for DefaultSkillExecutor<T, H>
impl<T: Transport, H: ExecutionHooks> SkillExecutor for DefaultSkillExecutor<T, H>
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
skill: &'life1 Skill,
context: &'life2 mut ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<SkillResult, SkillError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
skill: &'life1 Skill,
context: &'life2 mut ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<SkillResult, SkillError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a complete skill. Read more
Source§fn execute_step<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
step: &'life1 SkillStep,
context: &'life2 mut ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<StepResult, SkillError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_step<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
step: &'life1 SkillStep,
context: &'life2 mut ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<StepResult, SkillError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a single step. Read more
Auto Trait Implementations§
impl<T, H> Freeze for DefaultSkillExecutor<T, H>
impl<T, H> RefUnwindSafe for DefaultSkillExecutor<T, H>where
T: RefUnwindSafe,
H: RefUnwindSafe,
impl<T, H> Send for DefaultSkillExecutor<T, H>
impl<T, H> Sync for DefaultSkillExecutor<T, H>
impl<T, H> Unpin for DefaultSkillExecutor<T, H>
impl<T, H> UnsafeUnpin for DefaultSkillExecutor<T, H>
impl<T, H> UnwindSafe for DefaultSkillExecutor<T, H>where
T: RefUnwindSafe,
H: RefUnwindSafe,
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