pub struct VectorDatabase { /* private fields */ }Implementations§
Source§impl VectorDatabase
impl VectorDatabase
pub fn new(name: &str) -> Result<Self>
pub fn embeddings_dir() -> Result<PathBuf>
pub fn list_databases() -> Result<Vec<String>>
pub fn list_databases_in_dir(embeddings_dir: &Path) -> Result<Vec<String>>
pub fn delete_database(name: &str) -> Result<()>
pub fn delete_database_in_dir(name: &str, embeddings_dir: &Path) -> Result<()>
pub fn add_vector( &self, text: &str, vector: &[f64], model: &str, provider: &str, ) -> Result<i64>
pub fn add_vector_with_metadata( &self, text: &str, vector: &[f64], model: &str, provider: &str, file_path: Option<&str>, chunk_index: Option<i32>, total_chunks: Option<i32>, ) -> Result<i64>
pub fn get_all_vectors(&self) -> Result<Vec<VectorEntry>>
pub fn get_model_info(&self) -> Result<Option<(String, String)>>
pub fn find_similar( &self, query_vector: &[f64], limit: usize, ) -> Result<Vec<(VectorEntry, f64)>>
pub fn count(&self) -> Result<usize>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VectorDatabase
impl !RefUnwindSafe for VectorDatabase
impl Send for VectorDatabase
impl Sync for VectorDatabase
impl Unpin for VectorDatabase
impl !UnwindSafe for VectorDatabase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.