Skip to main content

RunExecutor

Trait RunExecutor 

Source
pub trait RunExecutor:
    Send
    + Sync
    + 'static {
    // Required method
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        run_id: RunId,
        agent: String,
        input: String,
        history: Vec<Message>,
        context: ToolContext,
        cancellation: CancellationToken,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionReport, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn execute_with_event_sink<'life0, 'async_trait>(
        &'life0 self,
        run_id: RunId,
        agent: String,
        input: String,
        history: Vec<Message>,
        context: ToolContext,
        cancellation: CancellationToken,
        event_sink: Arc<dyn EventSink>,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionReport, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Executes an accepted agent run with its conversation history and trusted context.

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, run_id: RunId, agent: String, input: String, history: Vec<Message>, context: ToolContext, cancellation: CancellationToken, ) -> Pin<Box<dyn Future<Output = Result<ExecutionReport, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn execute_with_event_sink<'life0, 'async_trait>( &'life0 self, run_id: RunId, agent: String, input: String, history: Vec<Message>, context: ToolContext, cancellation: CancellationToken, event_sink: Arc<dyn EventSink>, ) -> Pin<Box<dyn Future<Output = Result<ExecutionReport, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Executes while forwarding runtime events as they occur. Executors that do not support live events may keep the default batch-based behavior.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§