💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Update docs
davidmezzettib6afdfde5911
diff --git a/src/python/txtai/api.py b/src/python/txtai/api.pyindex bd33c18c..23feeccd 100644--- a/src/python/txtai/api.py+++ b/src/python/txtai/api.py@@ -188,7 +188,7 @@ class API(object):def similarity(self, query, texts):"""- Computes the similarity between query and list of strings. Returns a list of+ Computes the similarity between query and list of text. Returns a list of(id, score) sorted by highest score, where id is the index in texts.Args:@@ -209,7 +209,7 @@ class API(object):def batchsimilarity(self, queries, texts):"""- Computes the similarity between list of queries and list of strings. Returns a list+ Computes the similarity between list of queries and list of text. Returns a listof (id, score) sorted by highest score per query, where id is the index in texts.Args:@@ -233,7 +233,7 @@ class API(object):Transforms list of texts into embeddings arrays.Args:- texts: list of strings+ texts: list of textReturns:embeddings arrays@@ -250,7 +250,7 @@ class API(object):Args:queue: list of {name: value, query: value, question: value, snippet: value}- texts: list of strings+ texts: list of textReturns:list of (name, answer)@@ -381,7 +381,7 @@ def index():@app.post("/similarity")def similarity(query: str = Body(...), texts: List[str] = Body(...)):"""- Computes the similarity between query and list of strings. Returns a list of+ Computes the similarity between query and list of text. Returns a list of(id, score) sorted by highest score, where id is the index in texts.Args:@@ -397,7 +397,7 @@ def similarity(query: str = Body(...), texts: List[str] = Body(...)):@app.post("/batchsimilarity")def batchsimilarity(queries: List[str] = Body(...), texts: List[str] = Body(...)):"""- Computes the similarity between list of queries and list of strings. Returns a list+ Computes the similarity between list of queries and list of text. Returns a listof (id, score) sorted by highest score per query, where id is the index in texts.Args:@@ -430,7 +430,7 @@ def batchembeddings(texts: List[str] = Body(...)):Transforms list of text into embeddings arrays.Args:- texts: list of strings+ texts: list of textReturns:embeddings arrays@@ -445,7 +445,7 @@ def extract(queue: List[dict] = Body(...), texts: List[str] = Body(...)):Args:queue: list of {name: value, query: value, question: value, snippet: value)- texts: list of strings+ texts: list of textReturns:list of (name, answer)diff --git a/src/python/txtai/embeddings.py b/src/python/txtai/embeddings.pyindex fb5ab4fa..dba18a6b 100644--- a/src/python/txtai/embeddings.py+++ b/src/python/txtai/embeddings.py@@ -233,7 +233,7 @@ class Embeddings(object):def similarity(self, query, texts):"""- Computes the similarity between query and list of strings. Returns a list of+ Computes the similarity between query and list of text. Returns a list of(id, score) sorted by highest score, where id is the index in texts.Args:@@ -248,7 +248,7 @@ class Embeddings(object):def batchsimilarity(self, queries, texts):"""- Computes the similarity between list of queries and list of strings. Returns a list+ Computes the similarity between list of queries and list of text. Returns a listof (id, score) sorted by highest score per query, where id is the index in texts.Args:diff --git a/src/python/txtai/extractor.py b/src/python/txtai/extractor.pyindex 5d293750..885a1bbf 100644--- a/src/python/txtai/extractor.py+++ b/src/python/txtai/extractor.py@@ -42,7 +42,7 @@ class Extractor(object):Args:queue: input queue (name, query, question, snippet)- texts: list of strings+ texts: list of textReturns:list of (name, answer)@@ -72,7 +72,7 @@ class Extractor(object):Args:queries: list of embedding queries to run- texts: list of strings+ texts: list of textReturns:list of (id, text, score)diff --git a/src/python/txtai/pipeline.py b/src/python/txtai/pipeline.pyindex 8a9f54a3..4a2b1c52 100644--- a/src/python/txtai/pipeline.py+++ b/src/python/txtai/pipeline.py@@ -123,12 +123,12 @@ class Labels(Pipeline):class Similarity(Labels):"""- Computes similarity between query and list of strings using a zero shot classifier.+ Computes similarity between query and list of text using a zero shot classifier."""def __call__(self, query, texts, multiclass=True):"""- Computes the similarity between query and list of strings. Returns a list of+ Computes the similarity between query and list of text. Returns a list of(id, score) sorted by highest score, where id is the index in texts.This method supports query as a string or a list. If the input is a string,