Trait VectorStore

Source
pub trait VectorStore: Send + Sync {
    // Required methods
    fn add_documents<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        docs: &'life1 [Document],
        opt: &'life2 VecStoreOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Box<dyn Error>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn similarity_search<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        limit: usize,
        opt: &'life2 VecStoreOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Document>, Box<dyn Error>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}

Required Methods§

Source

fn add_documents<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, docs: &'life1 [Document], opt: &'life2 VecStoreOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Trait Implementations§

Source§

impl<VS> From<VS> for Box<dyn VectorStore>
where VS: 'static + VectorStore,

Source§

fn from(vector_store: VS) -> Self

Converts to this type from the input type.

Implementors§