pub trait LanguageModel {
type Error: Error + Send + Sync + 'static;
// Required methods
fn complete(&self, prompt: &str) -> Result<String>;
fn complete_with_params(
&self,
prompt: &str,
params: GenerationParams,
) -> Result<String>;
fn is_available(&self) -> bool;
fn model_info(&self) -> ModelInfo;
}Expand description
Large Language Model abstraction for text generation
§Synchronous Version
This trait provides synchronous operations for text generation.
Required Associated Types§
Required Methods§
Sourcefn complete_with_params(
&self,
prompt: &str,
params: GenerationParams,
) -> Result<String>
fn complete_with_params( &self, prompt: &str, params: GenerationParams, ) -> Result<String>
Generate text with custom parameters
Sourcefn is_available(&self) -> bool
fn is_available(&self) -> bool
Check if the model is available
Sourcefn model_info(&self) -> ModelInfo
fn model_info(&self) -> ModelInfo
Get model information