pub struct VectorStoreRetriever<S: VectorStore> { /* private fields */ }Expand description
A retriever that wraps a VectorStore, bridging it to the Retriever trait.
Implementations§
Source§impl<S: VectorStore + 'static> VectorStoreRetriever<S>
impl<S: VectorStore + 'static> VectorStoreRetriever<S>
pub fn new(store: Arc<S>, embeddings: Arc<dyn Embeddings>, k: usize) -> Self
Sourcepub fn with_score_threshold(self, threshold: f32) -> Self
pub fn with_score_threshold(self, threshold: f32) -> Self
Set a minimum similarity score threshold. Only documents with a score greater than or equal to the threshold will be returned.
Trait Implementations§
Source§impl<S: VectorStore + 'static> Retriever for VectorStoreRetriever<S>
impl<S: VectorStore + 'static> Retriever for VectorStoreRetriever<S>
Auto Trait Implementations§
impl<S> Freeze for VectorStoreRetriever<S>
impl<S> !RefUnwindSafe for VectorStoreRetriever<S>
impl<S> Send for VectorStoreRetriever<S>
impl<S> Sync for VectorStoreRetriever<S>
impl<S> Unpin for VectorStoreRetriever<S>
impl<S> UnsafeUnpin for VectorStoreRetriever<S>
impl<S> !UnwindSafe for VectorStoreRetriever<S>
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