Skip to main content

LlmClient

Trait LlmClient 

Source
pub trait LlmClient:
    Send
    + Sync
    + Debug {
    // Required methods
    fn complete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prompt: &'life1 str,
        max_tokens: u32,
    ) -> Pin<Box<dyn Future<Output = Result<CompletionResult, LlmError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn model_id(&self) -> &str;
}
Expand description

Shared interface for LLM clients.

Required Methods§

Source

fn complete<'life0, 'life1, 'async_trait>( &'life0 self, prompt: &'life1 str, max_tokens: u32, ) -> Pin<Box<dyn Future<Output = Result<CompletionResult, LlmError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run a single non-streaming completion.

Source

fn model_id(&self) -> &str

Stable identifier used by the cost tracker price table.

Implementors§