Skip to main content

RuntimeAwareTool

Trait RuntimeAwareTool 

Source
pub trait RuntimeAwareTool: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn call_with_runtime<'life0, 'async_trait>(
        &'life0 self,
        args: Value,
        runtime: ToolRuntime,
    ) -> Pin<Box<dyn Future<Output = Result<Value, SynapticError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn parameters(&self) -> Option<Value> { ... }
    fn as_tool_definition(&self) -> ToolDefinition { ... }
}
Expand description

Context-aware tool that receives runtime information.

This extends the basic Tool trait with runtime context (current state, store, stream writer, tool call ID). Implement this for tools that need to read or modify graph state.

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn description(&self) -> &'static str

Source

fn call_with_runtime<'life0, 'async_trait>( &'life0 self, args: Value, runtime: ToolRuntime, ) -> Pin<Box<dyn Future<Output = Result<Value, SynapticError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Implementors§