lancedb.py 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. from typing import Optional
  2. from embedchain.config.vectordb.base import BaseVectorDbConfig
  3. from embedchain.helpers.json_serializable import register_deserializable
  4. @register_deserializable
  5. class LanceDBConfig(BaseVectorDbConfig):
  6. def __init__(
  7. self,
  8. collection_name: Optional[str] = None,
  9. dir: Optional[str] = None,
  10. host: Optional[str] = None,
  11. port: Optional[str] = None,
  12. allow_reset=True,
  13. ):
  14. """
  15. Initializes a configuration class instance for LanceDB.
  16. :param collection_name: Default name for the collection, defaults to None
  17. :type collection_name: Optional[str], optional
  18. :param dir: Path to the database directory, where the database is stored, defaults to None
  19. :type dir: Optional[str], optional
  20. :param host: Database connection remote host. Use this if you run Embedchain as a client, defaults to None
  21. :type host: Optional[str], optional
  22. :param port: Database connection remote port. Use this if you run Embedchain as a client, defaults to None
  23. :type port: Optional[str], optional
  24. :param allow_reset: Resets the database. defaults to False
  25. :type allow_reset: bool
  26. """
  27. self.allow_reset = allow_reset
  28. super().__init__(collection_name=collection_name, dir=dir, host=host, port=port)