pub struct VectorStoreRetriever { /* private fields */ }
Expand description
A retriever that wraps a vector store
Implementations§
Source§impl VectorStoreRetriever
impl VectorStoreRetriever
Sourcepub fn new(vector_store: Box<dyn VectorStore>) -> Self
pub fn new(vector_store: Box<dyn VectorStore>) -> Self
Create a new vector store retriever
Sourcepub fn new_with_kwargs(
vector_store: Box<dyn VectorStore>,
search_kwargs: HashMap<String, Value>,
) -> Self
pub fn new_with_kwargs( vector_store: Box<dyn VectorStore>, search_kwargs: HashMap<String, Value>, ) -> Self
Create a new vector store retriever with search parameters
Sourcepub fn add_search_kwarg(&mut self, key: impl Into<String>, value: Value)
pub fn add_search_kwarg(&mut self, key: impl Into<String>, value: Value)
Add a search parameter
Trait Implementations§
Source§impl BaseRetriever for VectorStoreRetriever
impl BaseRetriever for VectorStoreRetriever
Source§fn get_relevant_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<RetrieverResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_relevant_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<RetrieverResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve documents based on a query
Source§fn get_relevant_documents_batch<'life0, 'async_trait>(
&'life0 self,
queries: Vec<String>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<RetrieverResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_relevant_documents_batch<'life0, 'async_trait>(
&'life0 self,
queries: Vec<String>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<RetrieverResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve documents for multiple queries
Source§fn input_schema(&self) -> Option<Value>
fn input_schema(&self) -> Option<Value>
Get the input schema for this retriever
Source§fn output_schema(&self) -> Option<Value>
fn output_schema(&self) -> Option<Value>
Get the output schema for this retriever
Auto Trait Implementations§
impl Freeze for VectorStoreRetriever
impl !RefUnwindSafe for VectorStoreRetriever
impl Send for VectorStoreRetriever
impl Sync for VectorStoreRetriever
impl Unpin for VectorStoreRetriever
impl !UnwindSafe for VectorStoreRetriever
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