Skip to main content

AgentRuntime

Trait AgentRuntime 

Source
pub trait AgentRuntime: Send + Sync {
    // Required methods
    fn run<'life0, 'async_trait>(
        &'life0 self,
        req: AgentRequest,
    ) -> Pin<Box<dyn Future<Output = Result<AgentRunResult, AgentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn run_stream<'life0, 'async_trait>(
        &'life0 self,
        req: AgentRequest,
    ) -> Pin<Box<dyn Future<Output = Result<AgentEventStream, AgentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn health<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RuntimeHealth> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The primary API for running agent turns.

Required Methods§

Source

fn run<'life0, 'async_trait>( &'life0 self, req: AgentRequest, ) -> Pin<Box<dyn Future<Output = Result<AgentRunResult, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute a single agent turn (blocking until complete).

Source

fn run_stream<'life0, 'async_trait>( &'life0 self, req: AgentRequest, ) -> Pin<Box<dyn Future<Output = Result<AgentEventStream, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute a single agent turn with streaming events.

Source

fn health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RuntimeHealth> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check runtime health.

Implementors§