Skip to main content

TextModel

Trait TextModel 

Source
pub trait TextModel: Send + Sync {
    // Required method
    fn complete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prompt: &'life1 Prompt,
    ) -> Pin<Box<dyn Future<Output = Result<Completion, TextModelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Completes a prompt, over whichever provider the venture wired for the Prompt::tier it was asked for. An adapter serves any tier it is configured for (typically one); RoutingTextModel dispatches between the adapters a venture configured.

Required Methods§

Source

fn complete<'life0, 'life1, 'async_trait>( &'life0 self, prompt: &'life1 Prompt, ) -> Pin<Box<dyn Future<Output = Result<Completion, TextModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Completes prompt.

Prompt::json_schema is a request: an adapter whose provider cannot honour structured output answers with plain text in Completion::text and None in Completion::json, rather than failing the call.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§