mini_rag/
lib.rs

1#[macro_use]
2extern crate anyhow;
3
4use anyhow::Result;
5use async_trait::async_trait;
6use serde::{Deserialize, Serialize};
7
8mod document;
9mod metrics;
10mod naive;
11
12pub use document::*;
13pub use metrics::*;
14pub use naive::*;
15
16mod import;
17
18pub type Embeddings = Vec<f64>;
19
20#[async_trait]
21pub trait Embedder: Send + Sync {
22    async fn embed(&self, text: &str) -> Result<Embeddings>;
23}
24
25#[derive(Clone, Debug, Default, Serialize, Deserialize)]
26pub struct Configuration {
27    pub source_path: String,
28    pub data_path: String,
29    pub chunk_size: Option<usize>,
30}