Trait AiProvider
Source pub trait AiProvider: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn supported_models(&self) -> HashSet<Model>;
fn converse<'life0, 'async_trait>(
&'life0 self,
request: ConversationRequest,
) -> Pin<Box<dyn Future<Output = Result<ConversationResponse, AiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_cost(&self, model: &Model) -> Cost;
// Provided methods
fn converse_stream<'life0, 'async_trait>(
&'life0 self,
request: ConversationRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamEvent, AiError>> + Send>>, AiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn tweaks(&self) -> ModelTweaks { ... }
}