manx_cli/rag/providers/
mod.rs1use anyhow::Result;
2
3pub mod custom;
4pub mod hash;
5pub mod huggingface;
6pub mod ollama;
7pub mod onnx;
8pub mod openai;
9
10#[async_trait::async_trait]
12pub trait EmbeddingProvider: std::any::Any {
13 async fn embed_text(&self, text: &str) -> Result<Vec<f32>>;
15
16 async fn get_dimension(&self) -> Result<usize>;
18
19 async fn health_check(&self) -> Result<()>;
21
22 fn get_info(&self) -> ProviderInfo;
24
25 fn as_any(&self) -> &dyn std::any::Any;
27}
28
29#[derive(Debug, Clone)]
31pub struct ProviderInfo {
32 pub name: String,
33 pub provider_type: String,
34 pub model_name: Option<String>,
35 pub description: String,
36 pub max_input_length: Option<usize>,
37}