mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-27 07:46:25 +00:00
feat(ai): provider-agnostic AI crate (Anthropic, OpenAI, Gemini, compatible)
Streaming chat, embeddings (Embedder impl), key stores, retries/cancellation, and graph features: ask_graph, summarize_journal, suggest_links_and_tags, extract_tasks, consolidate_week. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fbcfcf678f
commit
6697924bf5
20 files changed
+4084
-6
No files matched your search
@@ -0,0 +1,22 @@
|
||||
mod anthropic;
|
||||
mod gemini;
|
||||
mod openai;
|
||||
|
||||
pub use anthropic::Anthropic;
|
||||
pub use gemini::Gemini;
|
||||
pub use openai::OpenAi;
|
||||
|
||||
/// Embedding batch size per request.
|
||||
pub(crate) const EMBED_BATCH: usize = 96;
|
||||
|
||||
/// Vector sizes of well-known embedding models.
|
||||
pub(crate) fn known_embed_dims(model: &str) -> Option<usize> {
|
||||
Some(match model {
|
||||
"text-embedding-3-small" | "text-embedding-ada-002" => 1536,
|
||||
"text-embedding-3-large" | "gemini-embedding-001" => 3072,
|
||||
"text-embedding-004" | "nomic-embed-text" => 768,
|
||||
"mxbai-embed-large" | "bge-large" => 1024,
|
||||
"all-minilm" => 384,
|
||||
_ => return None,
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user