Struct txtai::embeddings::Embeddings [−][src]
pub struct Embeddings { /* fields omitted */ }
Expand description
Embeddings definition
Implementations
impl Embeddings
[src]
impl Embeddings
[src]Embeddings implementation
pub fn new(url: &str) -> Embeddings
[src]
pub fn new(url: &str) -> Embeddings
[src]pub async fn query(&self, query: &str, limit: i32) -> APIResponse
[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]
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]
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 add<T: Serialize>(&self, documents: &Vec<T>) -> APIResponse
[src]pub async fn index(&self) -> APIResponse
[src]
pub async fn index(&self) -> APIResponse
[src]Builds an embeddings index for previously batched documents.
pub async fn upsert(&self) -> APIResponse
[src]
pub async fn upsert(&self) -> APIResponse
[src]Runs an embeddings upsert operation for previously batched documents.
pub async fn delete(&self, ids: &Vec<&str>) -> Ids
[src]
pub async fn delete(&self, ids: &Vec<&str>) -> Ids
[src]Deletes from an embeddings index. Returns list of ids deleted.
Arguments
ids
- list of ids to delete
pub async fn similarity(&self, query: &str, texts: &Vec<&str>) -> IndexResults
[src]
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]
pub async fn batchsimilarity(
&self,
queries: &Vec<&str>,
texts: &Vec<&str>
) -> IndexResultsBatch
[src]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 batchtransform(&self, texts: &str) -> EmbeddingBatch
[src]
pub async fn batchtransform(&self, texts: &str) -> EmbeddingBatch
[src]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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]