mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 15:26:17 +00:00
Domain model, SQLite graph store, link parser, journals chained in time, page origin/activity anchors, weighted synapses with spreading activation, content-addressed blob store and HLC op log with LWW remote apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 lines
526 B
Rust
12 lines
526 B
Rust
//! Embedding abstraction shared by `synapse-search` (consumer) and `synapse-ai` (providers).
|
|
|
|
pub type EmbedError = Box<dyn std::error::Error + Send + Sync>;
|
|
|
|
/// Turns texts into dense vectors. Implementations may block (network or local model).
|
|
pub trait Embedder: Send + Sync {
|
|
/// Stable identifier, e.g. `openai/text-embedding-3-small`. Indexes are keyed by it.
|
|
fn model_id(&self) -> String;
|
|
fn dims(&self) -> usize;
|
|
fn embed(&self, texts: &[String]) -> std::result::Result<Vec<Vec<f32>>, EmbedError>;
|
|
}
|