scripts/reset_qdrant.py aktualisiert
Some checks failed
Deploy mindnet to llm-node / deploy (push) Failing after 1s

This commit is contained in:
Lars 2025-09-05 07:15:20 +02:00
parent 5a089b6262
commit 40d915c4c4

View File

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""
Name: scripts/reset_qdrant.py
Version: v1.1.0 (2025-09-04)
Version: v1.1.1 (2025-09-05)
Kurzbeschreibung:
Sicheres Zurücksetzen der Qdrant-Collections für EIN Projektpräfix. Das Skript
ermittelt zunächst die tatsächlich betroffenen Collections und zeigt eine
@ -86,9 +86,21 @@ def confirm_or_abort(action: str, collections: List[str], nonexisting: List[str]
def delete_all_points(client: QdrantClient, collections: List[str]) -> None:
"""Löscht *alle* Points in den angegebenen Collections.
API-Kompatibilität:
- neuere qdrant-client: client.delete_points(...)
- ältere qdrant-client: client.delete(...)
"""
match_all = rest.Filter(must=[])
for col in collections:
try:
if hasattr(client, "delete_points"):
client.delete_points(collection_name=col, points_selector=match_all, wait=True)
else:
client.delete(collection_name=col, points_selector=match_all, wait=True)
except Exception as e:
print(f"Fehler beim Löschen der Points in {col}: {e}", file=sys.stderr)
raise
def wipe_collections(client: QdrantClient, all_col_names: List[str], existing: List[str]) -> None: