StreamingTool

Trait StreamingTool 

Source
pub trait StreamingTool:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn parameters(&self) -> Option<Value>;
    fn run<'life0, 'async_trait>(
        &'life0 self,
        args: Value,
        yield_tx: Sender<Value>,
    ) -> Pin<Box<dyn Future<Output = Result<(), ToolError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A streaming tool — runs in background, yields multiple results.

Required Methods§

Source

fn name(&self) -> &str

The unique name of this tool.

Source

fn description(&self) -> &str

Human-readable description of what this tool does.

Source

fn parameters(&self) -> Option<Value>

JSON Schema for the tool’s input parameters, or None if parameterless.

Source

fn run<'life0, 'async_trait>( &'life0 self, args: Value, yield_tx: Sender<Value>, ) -> Pin<Box<dyn Future<Output = Result<(), ToolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute the tool, sending intermediate results via yield_tx.

Implementors§