Struct rig::vector_store::NoIndex
source · pub struct NoIndex;
Trait Implementations§
source§impl VectorStoreIndex for NoIndex
impl VectorStoreIndex for NoIndex
source§async fn top_n_from_query(
&self,
_query: &str,
_n: usize,
) -> Result<Vec<(f64, DocumentEmbeddings)>, VectorStoreError>
async fn top_n_from_query( &self, _query: &str, _n: usize, ) -> Result<Vec<(f64, DocumentEmbeddings)>, VectorStoreError>
Get the top n documents based on the distance to the given embedding.
The distance is calculated as the cosine distance between the prompt and
the document embedding.
The result is a list of tuples with the distance and the document.
source§async fn top_n_from_embedding(
&self,
_prompt_embedding: &Embedding,
_n: usize,
) -> Result<Vec<(f64, DocumentEmbeddings)>, VectorStoreError>
async fn top_n_from_embedding( &self, _prompt_embedding: &Embedding, _n: usize, ) -> Result<Vec<(f64, DocumentEmbeddings)>, VectorStoreError>
Get the top n documents based on the distance to the given embedding.
The distance is calculated as the cosine distance between the prompt and
the document embedding.
The result is a list of tuples with the distance and the document.
source§fn top_n_documents_from_query<T: for<'a> Deserialize<'a>>(
&self,
query: &str,
n: usize,
) -> impl Future<Output = Result<Vec<(f64, T)>, VectorStoreError>> + Send
fn top_n_documents_from_query<T: for<'a> Deserialize<'a>>( &self, query: &str, n: usize, ) -> impl Future<Output = Result<Vec<(f64, T)>, VectorStoreError>> + Send
Same as
top_n_from_query
but returns the documents without its embeddings.
The documents are deserialized into the given type.source§fn top_n_ids_from_query(
&self,
query: &str,
n: usize,
) -> impl Future<Output = Result<Vec<(f64, String)>, VectorStoreError>> + Send
fn top_n_ids_from_query( &self, query: &str, n: usize, ) -> impl Future<Output = Result<Vec<(f64, String)>, VectorStoreError>> + Send
Same as
top_n_from_query
but returns the document ids only.source§fn top_n_documents_from_embedding<T: for<'a> Deserialize<'a>>(
&self,
prompt_embedding: &Embedding,
n: usize,
) -> impl Future<Output = Result<Vec<(f64, T)>, VectorStoreError>> + Send
fn top_n_documents_from_embedding<T: for<'a> Deserialize<'a>>( &self, prompt_embedding: &Embedding, n: usize, ) -> impl Future<Output = Result<Vec<(f64, T)>, VectorStoreError>> + Send
Same as
top_n_from_embedding
but returns the documents without its embeddings.
The documents are deserialized into the given type.Auto Trait Implementations§
impl Freeze for NoIndex
impl RefUnwindSafe for NoIndex
impl Send for NoIndex
impl Sync for NoIndex
impl Unpin for NoIndex
impl UnwindSafe for NoIndex
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