feat: Add vector database clearing

This commit is contained in:
shiyu
2025-09-07 16:48:14 +08:00
parent 72403d5861
commit b03f2619ca
5 changed files with 84 additions and 4 deletions

View File

@@ -75,3 +75,9 @@ class VectorDBService:
output_fields=["path"]
)
return [[{'id': r['path'], 'distance': 1.0, 'entity': {'path': r['path']}} for r in results]]
def clear_all_data(self):
"""清空所有集合的内容"""
collections = self.client.list_collections()
for collection_name in collections:
self.client.drop_collection(collection_name)