ChromaDbConfig.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from typing import Optional
  2. from embedchain.config.vectordbs.BaseVectorDbConfig import BaseVectorDbConfig
  3. from embedchain.helper.json_serializable import register_deserializable
  4. @register_deserializable
  5. class ChromaDbConfig(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. chroma_settings: Optional[dict] = None,
  13. ):
  14. """
  15. Initializes a configuration class instance for ChromaDB.
  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 chroma_settings: Chroma settings dict, defaults to None
  25. :type chroma_settings: Optional[dict], optional
  26. """
  27. """
  28. :param chroma_settings: Optional. Chroma settings for connection.
  29. """
  30. self.chroma_settings = chroma_settings
  31. super().__init__(collection_name=collection_name, dir=dir, host=host, port=port)