pub struct InMemoryRetriever { /* private fields */ }Expand description
In-memory retriever for small datasets and testing
Implementations§
Source§impl InMemoryRetriever
impl InMemoryRetriever
Sourcepub fn with_config(config: RetrieverConfig) -> Self
pub fn with_config(config: RetrieverConfig) -> Self
Create with custom configuration
Trait Implementations§
Source§impl Default for InMemoryRetriever
impl Default for InMemoryRetriever
Source§impl Retriever for InMemoryRetriever
impl Retriever for InMemoryRetriever
Source§fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 SearchQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<SearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 SearchQuery,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<SearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search for similar documents/chunks
Source§fn add_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
documents: &'life1 [(Document, Embedding)],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
documents: &'life1 [(Document, Embedding)],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add documents to the retrieval index
Source§fn add_chunks<'life0, 'life1, 'async_trait>(
&'life0 self,
chunks: &'life1 [(DocumentChunk, Embedding)],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_chunks<'life0, 'life1, 'async_trait>(
&'life0 self,
chunks: &'life1 [(DocumentChunk, Embedding)],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add document chunks to the retrieval index
Source§fn remove_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
document_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
document_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove documents from the index
Source§fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clear all documents from the index
Source§fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<IndexStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<IndexStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get index statistics
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check
Auto Trait Implementations§
impl Freeze for InMemoryRetriever
impl !RefUnwindSafe for InMemoryRetriever
impl Send for InMemoryRetriever
impl Sync for InMemoryRetriever
impl Unpin for InMemoryRetriever
impl !UnwindSafe for InMemoryRetriever
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