1
2
3
4
5
6
7
8
9
use async_trait::async_trait;

use super::EmbedderError;

#[async_trait]
pub trait Embedder: Send + Sync {
    async fn embed_documents(&self, documents: &[String]) -> Result<Vec<Vec<f64>>, EmbedderError>;
    async fn embed_query(&self, text: &str) -> Result<Vec<f64>, EmbedderError>;
}