pub trait LlmEngine: Send + Sync {
// Required methods
fn infer<'life0, 'async_trait>(
&'life0 mut self,
model: InferencingModel,
prompt: String,
params: InferencingParams,
) -> Pin<Box<dyn Future<Output = Result<InferencingResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn generate_embeddings<'life0, 'async_trait>(
&'life0 mut self,
model: EmbeddingModel,
data: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingsResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn summary(&self) -> Option<String> { ... }
}
Expand description
The interface for a language model engine.