Skip to main content

AgentBackend

Trait AgentBackend 

Source
pub trait AgentBackend: Send + Sync {
    // Required methods
    fn backend_type(&self) -> BackendType;
    fn spawn<'life0, 'async_trait>(
        &'life0 self,
        config: SpawnConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn AgentSession>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Factory trait: creates AgentSession instances for a specific backend.

Implementations are expected to be cheaply cloneable (or wrapped in Arc).

Required Methods§

Source

fn backend_type(&self) -> BackendType

Which backend this factory produces.

Source

fn spawn<'life0, 'async_trait>( &'life0 self, config: SpawnConfig, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn AgentSession>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Spawn a new agent and return a session handle.

Implementors§