base.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. from typing import Optional
  2. from embedchain.config.base_config import BaseConfig
  3. class BaseVectorDbConfig(BaseConfig):
  4. def __init__(
  5. self,
  6. collection_name: Optional[str] = None,
  7. dir: str = "db",
  8. host: Optional[str] = None,
  9. port: Optional[str] = None,
  10. **kwargs,
  11. ):
  12. """
  13. Initializes a configuration class instance for the vector database.
  14. :param collection_name: Default name for the collection, defaults to None
  15. :type collection_name: Optional[str], optional
  16. :param dir: Path to the database directory, where the database is stored, defaults to "db"
  17. :type dir: str, optional
  18. :param host: Database connection remote host. Use this if you run Embedchain as a client, defaults to None
  19. :type host: Optional[str], optional
  20. :param host: Database connection remote port. Use this if you run Embedchain as a client, defaults to None
  21. :type port: Optional[str], optional
  22. :param kwargs: Additional keyword arguments
  23. :type kwargs: dict
  24. """
  25. self.collection_name = collection_name or "embedchain_store"
  26. self.dir = dir
  27. self.host = host
  28. self.port = port
  29. # Assign additional keyword arguments
  30. if kwargs:
  31. for key, value in kwargs.items():
  32. setattr(self, key, value)