Returns
List of Tuples of (doc, similarity_score)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶
Run similarity search with distance asynchronously.
delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool][source]¶
Delete by vector ID.
Parameters
ids (List[str]) – List of ids to delete.
kwargs (Any) – Other optional parameters (unused)
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST[source]¶
Return the Vector Store initialized from texts and embeddings.
Parameters
cls (Type[VST]) – The Vector Store class to use to initialize
the Vector Store.
texts (List[str]) – The texts to initialize the Vector Store with.
embedding (Embeddings) – The embedding function to use.
metadatas (Optional[List[dict]], optional) – The metadata associated with
the texts. Defaults to None.
kwargs (Any) – Vector Store specific parameters. The following are forwarded
to the Vector Store constructor and required:
index_name (-) – The name of the index to store the documents
in. Defaults to “default”.
text_field (-) – The name of the metadata field to store the
original text in. Defaults to “text”.
distance_strategy (-) – The distance strategy to
use. Defaults to DistanceStrategy.COSINE. If you select