Struct txtai::embeddings::Embeddings [−][src]
pub struct Embeddings { /* fields omitted */ }
Embeddings definition
Implementations
impl Embeddings
[src]
impl Embeddings
[src]Embeddings implementation
pub fn new(url: &str) -> Embeddings
[src]
pub async fn query(&self, query: &str, limit: i32) -> APIResponse
[src]
Runs an Embeddings search. Returns Response. This method allows callers to customize the serialization of the response.
Arguments
query
- query textlimit
- maximum results
pub async fn search(&self, query: &str, limit: i32) -> SearchResults
[src]
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
pub async fn batchsearch(&self, queries: &str, limit: i32) -> SearchResultsBatch
[src]
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
pub async fn add<T: Serialize>(&self, documents: &Vec<T>) -> APIResponse
[src]
pub async fn index(&self) -> APIResponse
[src]
Builds an embeddings index for previously batched documents. No further documents can be added after this call.
pub async fn similarity(&self, query: &str, texts: &Vec<&str>) -> IndexResults
[src]
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
[src]
&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
pub async fn transform(&self, text: &str) -> Embedding
[src]
pub async fn batchtransform(&self, texts: &str) -> EmbeddingBatch
[src]
Auto Trait Implementations
impl RefUnwindSafe for Embeddings
impl RefUnwindSafe for Embeddings
impl Send for Embeddings
impl Send for Embeddings
impl Sync for Embeddings
impl Sync for Embeddings
impl Unpin for Embeddings
impl Unpin for Embeddings
impl UnwindSafe for Embeddings
impl UnwindSafe for Embeddings
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]