mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-08 22:42:05 +00:00
community: add delete method to rocksetdb vectorstore to support recordmanager (#17030)
- **Description:** This adds a delete method so that rocksetdb can be used with `RecordManager`. - **Issue:** N/A - **Dependencies:** N/A - **Twitter handle:** `@_morgan_adams_` --------- Co-authored-by: Rockset API Bot <admin@rockset.io>
This commit is contained in:
@@ -155,3 +155,19 @@ ORDER BY dist DESC
|
||||
LIMIT 4
|
||||
"""
|
||||
assert q_str == expected
|
||||
|
||||
def test_add_documents_and_delete(self) -> None:
|
||||
""" "add_documents" and "delete" are requirements to support use
|
||||
with RecordManager"""
|
||||
|
||||
texts = ["foo", "bar", "baz"]
|
||||
metadatas = [{"metadata_index": i} for i in range(len(texts))]
|
||||
|
||||
_docs = zip(texts, metadatas)
|
||||
docs = [Document(page_content=pc, metadata=i) for pc, i in _docs]
|
||||
|
||||
ids = self.rockset_vectorstore.add_documents(docs)
|
||||
assert len(ids) == len(texts)
|
||||
|
||||
deleted = self.rockset_vectorstore.delete(ids)
|
||||
assert deleted
|
||||
|
@@ -68,6 +68,7 @@ def test_compatible_vectorstore_documentation() -> None:
|
||||
"Pinecone",
|
||||
"Qdrant",
|
||||
"Redis",
|
||||
"Rockset",
|
||||
"ScaNN",
|
||||
"SemaDB",
|
||||
"SupabaseVectorStore",
|
||||
|
Reference in New Issue
Block a user