Skip to main content

cognee_embedding/
lib.rs

1//! Multi-provider text-embedding engine (ONNX, OpenAI-compatible, Ollama, Mock).
2
3/// Embedding engine configuration.
4pub mod config;
5/// `EmbeddingEngine` trait definition.
6pub mod engine;
7/// Error types for embedding operations.
8pub mod error;
9/// Mock embedding engine for tests.
10pub mod mock;
11/// Ollama embedding engine implementation.
12pub mod ollama;
13/// OpenAI-compatible embedding engine implementation.
14pub mod openai_compatible;
15/// Embedding provider selection.
16pub mod provider;
17/// Shared utilities for embedding input sanitization and response handling.
18pub mod utils;
19
20#[cfg(feature = "onnx")]
21/// Lazy model and tokenizer download from HuggingFace Hub.
22pub mod download;
23#[cfg(feature = "onnx")]
24/// ONNX Runtime-based local embedding engine.
25pub mod onnx;
26
27pub use config::EmbeddingConfig;
28pub use engine::EmbeddingEngine;
29pub use error::{EmbeddingError, EmbeddingResult};
30pub use mock::{MockEmbeddingEngine, MockVectorMode};
31pub use ollama::OllamaEmbeddingEngine;
32pub use openai_compatible::OpenAICompatibleEmbeddingEngine;
33pub use provider::EmbeddingProvider;
34pub use utils::{handle_embedding_response, is_embeddable, sanitize_embedding_inputs};
35
36#[cfg(feature = "onnx")]
37pub use config::OnnxEmbeddingConfig;
38#[cfg(feature = "onnx")]
39pub use download::{ModelUrls, download_model, ensure_model_exists, ensure_tokenizer_exists};
40#[cfg(feature = "onnx")]
41pub use onnx::OnnxEmbeddingEngine;