Trait BaseRetriever

Source
pub trait BaseRetriever:
    Send
    + Sync
    + 'static {
    // Required method
    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;

    // Provided methods
    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 input_schema(&self) -> Option<Value> { ... }
    fn output_schema(&self) -> Option<Value> { ... }
}
Expand description

Base trait for all retrievers

Required Methods§

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,

Retrieve documents based on a query

Provided Methods§

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,

Retrieve documents for multiple queries

Source

fn input_schema(&self) -> Option<Value>

Get the input schema for this retriever

Source

fn output_schema(&self) -> Option<Value>

Get the output schema for this retriever

Implementors§