base_vector_db.py 596 B

123456789101112131415161718192021222324252627
  1. class BaseVectorDB:
  2. """Base class for vector database."""
  3. def __init__(self):
  4. self.client = self._get_or_create_db()
  5. def _get_or_create_db(self):
  6. """Get or create the database."""
  7. raise NotImplementedError
  8. def _get_or_create_collection(self):
  9. raise NotImplementedError
  10. def get(self):
  11. raise NotImplementedError
  12. def add(self):
  13. raise NotImplementedError
  14. def query(self):
  15. raise NotImplementedError
  16. def count(self):
  17. raise NotImplementedError
  18. def reset(self):
  19. raise NotImplementedError