episteme 0.3.7

Knowledge graph for software engineering — design patterns, refactorings, and laws for AI agents
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
/// Abstraction over embedding backends (local ONNX, OpenAI, etc.).
pub trait EmbeddingProvider: Send + Sync {
    /// Dimensionality of the vectors this provider returns.
    fn embedding_dim(&self) -> usize;

    /// Embed a single text string.
    fn embed(&self, text: &str) -> Result<Vec<f32>, String>;

    /// Embed a batch of texts. `batch_size` controls how many texts are
    /// sent to the backend in a single call (the method internally loops).
    fn embed_batch(&self, texts: &[&str], batch_size: usize) -> Result<Vec<Vec<f32>>, String>;
}