base_vector_db.py 689 B

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