pub trait GeneratorModel: Send + Sync {
// Required method
fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [String],
options: GenerationOptions,
) -> Pin<Box<dyn Future<Output = Result<GenerationResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn warmup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
A model that generates text from a conversational message history.
Messages are passed as a flat &[String] slice where even-indexed entries
(0, 2, 4, …) are user turns and odd-indexed entries are assistant turns.
Required Methods§
Sourcefn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [String],
options: GenerationOptions,
) -> Pin<Box<dyn Future<Output = Result<GenerationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [String],
options: GenerationOptions,
) -> Pin<Box<dyn Future<Output = Result<GenerationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate a response given a conversation history and sampling options.