pub struct MultiRetriever { /* private fields */ }
Expand description
A retriever that combines multiple retrievers
Implementations§
Source§impl MultiRetriever
impl MultiRetriever
Sourcepub fn new(retrievers: Vec<Box<dyn BaseRetriever>>) -> Self
pub fn new(retrievers: Vec<Box<dyn BaseRetriever>>) -> Self
Create a new multi-retriever
Sourcepub fn new_with_method(
retrievers: Vec<Box<dyn BaseRetriever>>,
combine_method: CombineMethod,
) -> Self
pub fn new_with_method( retrievers: Vec<Box<dyn BaseRetriever>>, combine_method: CombineMethod, ) -> Self
Create a new multi-retriever with a specific combine method
Sourcepub fn add_retriever(&mut self, retriever: Box<dyn BaseRetriever>)
pub fn add_retriever(&mut self, retriever: Box<dyn BaseRetriever>)
Add a retriever to the multi-retriever
Sourcepub fn set_combine_method(&mut self, method: CombineMethod)
pub fn set_combine_method(&mut self, method: CombineMethod)
Set the combine method
Trait Implementations§
Source§impl BaseRetriever for MultiRetriever
impl BaseRetriever for MultiRetriever
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 MultiRetriever
impl !RefUnwindSafe for MultiRetriever
impl Send for MultiRetriever
impl Sync for MultiRetriever
impl Unpin for MultiRetriever
impl !UnwindSafe for MultiRetriever
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