Skip to main content

ErasedToolExecutor

Trait ErasedToolExecutor 

Source
pub trait ErasedToolExecutor: Send + Sync {
    // Required methods
    fn execute_erased<'a>(
        &'a self,
        response: &'a str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>;
    fn execute_confirmed_erased<'a>(
        &'a self,
        response: &'a str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>;
    fn tool_definitions_erased(&self) -> Vec<ToolDef>;
    fn execute_tool_call_erased<'a>(
        &'a self,
        call: &'a ToolCall,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>;

    // Provided method
    fn set_skill_env(&self, _env: Option<HashMap<String, String>>) { ... }
}
Expand description

Object-safe erased version of ToolExecutor using boxed futures.

Implemented automatically for all T: ToolExecutor + 'static. Use Box<dyn ErasedToolExecutor> when dynamic dispatch is required.

Required Methods§

Source

fn execute_erased<'a>( &'a self, response: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>

Source

fn execute_confirmed_erased<'a>( &'a self, response: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>

Source

fn tool_definitions_erased(&self) -> Vec<ToolDef>

Source

fn execute_tool_call_erased<'a>( &'a self, call: &'a ToolCall, ) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>

Provided Methods§

Source

fn set_skill_env(&self, _env: Option<HashMap<String, String>>)

Inject environment variables for the currently active skill. No-op by default.

Implementors§