use async_trait::async_trait;
pub struct EmbeddingRequest<'a> {
pub model: &'a str,
pub texts: Vec<&'a str>,
}
pub struct EmbeddingResponse {
pub embeddings: Vec<Vec<f32>>,
}
#[async_trait]
pub trait EmbeddingProvider: Send + Sync {
fn name(&self) -> &str;
fn batch_limit(&self) -> usize {
512
}
async fn embed(&self, req: EmbeddingRequest<'_>) -> anyhow::Result<EmbeddingResponse>;
}