pub trait LlmBackend: Send + Sync {
// Required methods
fn model(&self) -> &str;
fn complete(&self, request: &str) -> Result<String>;
}Expand description
A backend that answers one JSON request with one JSON response. Object-safe
so the engine can hold a Box<dyn LlmBackend>.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T: LlmBackend + ?Sized> LlmBackend for Box<T>
Boxed backends forward — lets decorators wrap Box<dyn LlmBackend>
without knowing the concrete type.
impl<T: LlmBackend + ?Sized> LlmBackend for Box<T>
Boxed backends forward — lets decorators wrap Box<dyn LlmBackend>
without knowing the concrete type.