CompletionProvider

Trait CompletionProvider 

Source
pub trait CompletionProvider {
    // Required method
    fn complete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: &'life1 CompletionRequest,
        json_schema: Option<StructuredOutputFormat>,
    ) -> Pin<Box<dyn Future<Output = Result<CompletionResponse, LLMError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for providers that support text completion requests.

Required Methods§

Source

fn complete<'life0, 'life1, 'async_trait>( &'life0 self, req: &'life1 CompletionRequest, json_schema: Option<StructuredOutputFormat>, ) -> Pin<Box<dyn Future<Output = Result<CompletionResponse, LLMError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a completion request to generate text.

§Arguments
  • req - The completion request parameters
§Returns

The generated completion text or an error

Implementors§