Skip to main content

LlmBackend

Trait LlmBackend 

Source
pub trait LlmBackend: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn complete(&self, prompt: &str) -> Result<String, LlmError>;
}
Expand description

One-shot completion: prompt in, raw text out.

Required Methods§

Source

fn name(&self) -> &str

Human-readable backend name, for logs and audit output.

Source

fn complete(&self, prompt: &str) -> Result<String, LlmError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§