#![allow(unused_variables)]
#![allow(dead_code)]
use crate::vectordb::embedding::EmbeddingModelType;
use crate::vectordb::error::Result;
use serde::{Deserialize, Serialize};
use std::fmt::Debug;
use std::path::PathBuf;
pub trait EmbeddingProvider: Send + Sync + Debug {
fn dimension(&self) -> usize;
fn model_type(&self) -> EmbeddingModelType;
fn embed_batch(&self, texts: &[&str]) -> Result<Vec<Vec<f32>>>;
}
pub mod onnx;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct EmbeddingModelConfig {
pub model_type: EmbeddingModelType,
pub onnx_model_path: Option<PathBuf>,
pub onnx_tokenizer_path: Option<PathBuf>,
}
impl EmbeddingModelConfig {
pub fn new(model_type: EmbeddingModelType) -> Self {
Self {
model_type,
onnx_model_path: None,
onnx_tokenizer_path: None,
}
}
}