Skip to main content

Runner

Trait Runner 

Source
pub trait Runner {
    // Required methods
    fn send(
        &mut self,
        agent: &str,
        content: &str,
    ) -> impl Future<Output = Result<String>> + Send;
    fn stream<'a>(
        &'a mut self,
        agent: &'a str,
        content: &'a str,
    ) -> impl Stream<Item = Result<String>> + Send + 'a;
}
Expand description

Unified interface for sending messages and streaming responses.

Required Methods§

Source

fn send( &mut self, agent: &str, content: &str, ) -> impl Future<Output = Result<String>> + Send

Send a one-shot message and return the response content.

Source

fn stream<'a>( &'a mut self, agent: &'a str, content: &'a str, ) -> impl Stream<Item = Result<String>> + Send + 'a

Stream a response, yielding content text chunks.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§