This commit is contained in:
30
tools/test/simple_delete.py
Normal file
30
tools/test/simple_delete.py
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
简单删除 Qdrant 集合
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
project_root = os.path.join(os.path.dirname(__file__), "..", "..")
|
||||
sys.path.insert(0, os.path.join(project_root, "backend"))
|
||||
|
||||
from rag_core.client import create_qdrant_client
|
||||
|
||||
|
||||
def delete_collection():
|
||||
print("="*70)
|
||||
print("删除 rag_documents 集合...")
|
||||
print("="*70)
|
||||
|
||||
client = create_qdrant_client()
|
||||
|
||||
try:
|
||||
client.delete_collection("rag_documents")
|
||||
print("✅ 删除成功")
|
||||
except Exception as e:
|
||||
print(f"⚠️ 删除失败: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
delete_collection()
|
||||
Reference in New Issue
Block a user