Skip to main content

AgentSession

Trait AgentSession 

Source
pub trait AgentSession: Send + Sync {
    // Required method
    fn chat<'life0, 'life1, 'async_trait>(
        &'life0 self,
        input: &'life1 str,
        context: RequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<AgentResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Per-session agent handle returned by an AgentBackend.

Each session holds its own conversation state and can process messages independently. Implementations must be Send + Sync so sessions can be held across async task boundaries.

Required Methods§

Source

fn chat<'life0, 'life1, 'async_trait>( &'life0 self, input: &'life1 str, context: RequestContext, ) -> Pin<Box<dyn Future<Output = Result<AgentResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Process a user message and return the agent’s response.

The context carries per-request overrides such as system prompt augmentation, skill selections, and tool policy adjustments.

Implementors§