Skip to main content

AgentBackend

Trait AgentBackend 

Source
pub trait AgentBackend: Send + Sync {
    // Required method
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        request: AgentRequest,
    ) -> Pin<Box<dyn Future<Output = Result<AgentHandle>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A backend that can execute an AI agent task.

Callers don’t know or care whether this is a raw API call, a headless CLI process, or something else.

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, request: AgentRequest, ) -> Pin<Box<dyn Future<Output = Result<AgentHandle>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute a prompt with optional tool access.

Returns a handle for streaming events and awaiting the final result.

Implementors§