use crate::context::Context;
use crate::error::Result;
use crate::message::Response;
use crate::stream::StreamEvent;
#[async_trait::async_trait]
pub trait Provider: Send + Sync {
fn name(&self) -> &str;
fn requires_api_key(&self) -> bool;
async fn complete(&self, context: &Context) -> Result<Response>;
async fn is_available(&self) -> bool;
}
#[async_trait::async_trait]
pub trait StreamingProvider: Provider {
async fn complete_stream(
&self,
context: &Context,
) -> Result<tokio::sync::mpsc::Receiver<StreamEvent>>;
}
#[async_trait::async_trait]
pub trait Summarizer: Send + Sync {
async fn summarize(&self, text: &str) -> Result<String>;
}
#[async_trait::async_trait]
pub trait Store: Send + Sync {
async fn initialize(&self) -> Result<()>;
}