pub trait GeneratorModel: Send + Sync {
// Required method
fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
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, images, or audio from a conversational message history.
Messages carry explicit roles via Message and may contain multimodal
content (text and images). The output GenerationResult is a union:
text, images, and audio fields — consumers check what is populated.
Required Methods§
Sourcefn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
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 [Message],
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.