query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 4, text_in_page_content: Optional[str] = None, meta_filter: Optional[dict] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶
The most k similar documents and scores of the specified query.
Parameters
query – Text query.
k – The k most similar documents to the text query.
text_in_page_content – Filter by the text in page_content of Document.
meta_filter – Filter by metadata. Defaults to None.
kwargs – Any possible extend parameters in the future.
Returns
The k most similar documents to the specified text query.
0 is dissimilar, 1 is the most similar.
update(ids: List[str], texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str][source]¶
Update the documents which have the specified ids.
Parameters
ids – The id list of the updating embedding vector.
texts – The texts of the updating documents.
metadatas – The metadatas of the updating documents.
Returns
the ids of the updated documents.
use(table_name: str, **kwargs: Any) → bool[source]¶
Use the specified table. Don’t know the tables, please invoke list_tables.
Examples using AwaDB¶
AwaDB