Skip to main content

LlmExecutor

Trait LlmExecutor 

Source
pub trait LlmExecutor: Send + Sync {
    // Required methods
    fn exec_chat_response<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        model: &'life1 str,
        chat_req: ChatRequest,
        options: Option<&'life2 ChatOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<ChatResponse, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn exec_chat_stream_events<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        model: &'life1 str,
        chat_req: ChatRequest,
        options: Option<&'life2 ChatOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<ChatStreamEvent, Error>> + Send>>, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn name(&self) -> &'static str { ... }
}
Expand description

Provider-neutral LLM execution contract consumed by the loop runtime.

Required Methods§

Source

fn exec_chat_response<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, model: &'life1 str, chat_req: ChatRequest, options: Option<&'life2 ChatOptions>, ) -> Pin<Box<dyn Future<Output = Result<ChatResponse, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Execute one non-streaming chat call.

Source

fn exec_chat_stream_events<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, model: &'life1 str, chat_req: ChatRequest, options: Option<&'life2 ChatOptions>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<ChatStreamEvent, Error>> + Send>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Execute one streaming chat call.

Provided Methods§

Source

fn name(&self) -> &'static str

Stable executor label for debug/telemetry output.

Implementors§