Struct txtai::embeddings::Embeddings
source · [−]pub struct Embeddings { /* private fields */ }
Expand description
Embeddings definition
Implementations
Embeddings implementation
Runs an Embeddings search. Returns Response. This method allows callers to customize the serialization of the response.
Arguments
query
- query textlimit
- maximum results
Finds documents in the embeddings model most similar to the input query. Returns a list of {id: value, score: value} sorted by highest score, where id is the document id in the embeddings model.
Arguments
query
- query textlimit
- maximum results
Finds documents in the embeddings model most similar to the input queries. Returns a list of {id: value, score: value} sorted by highest score per query, where id is the document id in the embeddings model.
Arguments
queries
- queries textlimit
- maximum results
Builds an embeddings index for previously batched documents.
Runs an embeddings upsert operation for previously batched documents.
Deletes from an embeddings index. Returns list of ids deleted.
Arguments
ids
- list of ids to delete
Computes the similarity between query and list of text. Returns a list of {id: value, score: value} sorted by highest score, where id is the index in texts.
Arguments
query
- query texttexts
- list of text
pub async fn batchsimilarity(
&self,
queries: &Vec<&str>,
texts: &Vec<&str>
) -> IndexResultsBatch
pub async fn batchsimilarity(
&self,
queries: &Vec<&str>,
texts: &Vec<&str>
) -> IndexResultsBatch
Computes the similarity between list of queries and list of text. Returns a list of {id: value, score: value} sorted by highest score per query, where id is the index in texts.
Arguments
queries
- queries texttexts
- list of text
Auto Trait Implementations
impl RefUnwindSafe for Embeddings
impl Send for Embeddings
impl Sync for Embeddings
impl Unpin for Embeddings
impl UnwindSafe for Embeddings
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more