Return type
Optional[bool]
delete_by_document_id(document_id: str) → bool[source]¶
Remove a single document from the store, given its document_id (str).
Return True if a document has indeed been deleted, False if ID not found.
delete_collection() → None[source]¶
Completely delete the collection from the database (as opposed
to ‘clear()’, which empties it only).
Stored data is lost and unrecoverable, resources are freed.
Use with caution.
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → ADBVST[source]¶
Create an Astra DB vectorstore from a document list.
Utility method that defers to ‘from_texts’ (see that one).
Args: see ‘from_texts’, except here you have to supply ‘documents’in place of ‘texts’ and ‘metadatas’.
Returns
an AstraDB vectorstore.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → ADBVST[source]¶
Create an Astra DB vectorstore from raw texts.
Parameters
texts (List[str]) – the texts to insert.
embedding (Embeddings) – the embedding function to use in the store.
metadatas (Optional[List[dict]]) – metadata dicts for the texts.
ids (Optional[List[str]]) – ids to associate to the texts.
arguments* (*Additional) – you can pass any argument that you would
to ‘add_texts’ and/or to the ‘AstraDB’ class constructor
(see these methods for details). These arguments will be
routed to the respective methods as they are.
Returns
an AstraDb vectorstore.