TextAgent

Trait TextAgent 

pub trait TextAgent: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        state: &'life1 State,
    ) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}
Expand description

A text-based agent that runs via BaseLlm::generate() (request/response).

Unlike Agent (which requires a Live WebSocket session), TextAgent can be dispatched from anywhere — event hooks, background tasks, CLI tools.

Required Methods§

fn name(&self) -> &str

Human-readable name for logging and debugging.

fn run<'life0, 'life1, 'async_trait>( &'life0 self, state: &'life1 State, ) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Execute this agent. Reads/writes state. Returns the final text output.

Implementors§