milvus.py 914 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. from pymilvus import MilvusClient as Milvus
  2. from typing import Optional
  3. from open_webui.apps.rag.vector.main import VectorItem, QueryResult
  4. class MilvusClient:
  5. def __init__(self):
  6. self.client = Milvus()
  7. def list_collections(self) -> list[str]:
  8. pass
  9. def create_collection(self, collection_name: str):
  10. pass
  11. def delete_collection(self, collection_name: str):
  12. pass
  13. def search(
  14. self, collection_name: str, vectors: list[list[float | int]], limit: int
  15. ) -> Optional[QueryResult]:
  16. pass
  17. def get(self, collection_name: str) -> Optional[QueryResult]:
  18. pass
  19. def insert(self, collection_name: str, items: list[VectorItem]):
  20. pass
  21. def upsert(self, collection_name: str, items: list[VectorItem]):
  22. pass
  23. def delete(self, collection_name: str, ids: list[str]):
  24. pass
  25. def reset(self):
  26. pass