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§
Sourcefn backend_type(&self) -> BackendType
fn backend_type(&self) -> BackendType
Which backend this factory produces.
Sourcefn 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,
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.