Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dsrag/database/vector/qdrant_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ def remove_document(self, doc_id) -> None:
Args:
doc_id: The UUID of the document to remove.
"""
if not self.client.collection_exists(self.kb_id):
return

self.client.delete(
self.kb_id,
qdrant_client.models.Filter(
Expand Down Expand Up @@ -173,6 +176,9 @@ def search(
A list of dictionaries containing the metadata and similarity scores of
the top-k results.
"""
if not self.client.collection_exists(self.kb_id):
return []

if isinstance(query_vector, np.ndarray):
query_vector = query_vector.tolist()

Expand Down