use anyhow::Result; use futures::{future::BoxFuture, stream::BoxStream}; use crate::{auth::CredentialProvider, models::LanguageModel}; pub trait CompletionRequest: Send + Sync { fn data(&self) -> serde_json::Result; } pub trait CompletionProvider: CredentialProvider { fn base_model(&self) -> Box; fn complete( &self, prompt: Box, ) -> BoxFuture<'static, Result>>>; fn box_clone(&self) -> Box; } impl Clone for Box { fn clone(&self) -> Box { self.box_clone() } }