Skip to main content

CompletionModel

Trait CompletionModel 

Source
pub trait CompletionModel: Send + Sync {
    // Required method
    fn stream<'life0, 'async_trait>(
        &'life0 self,
        request: CompletionRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ModelStream, CompletionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A single completion model (as opposed to a provider, which is a catalog of models). Mostly useful for tests; see SingleModelProvider.

Required Methods§

Source

fn stream<'life0, 'async_trait>( &'life0 self, request: CompletionRequest, ) -> Pin<Box<dyn Future<Output = Result<ModelStream, CompletionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream one completion.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§