app_config.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from typing import Optional
  2. from embedchain.helper.json_serializable import register_deserializable
  3. from .BaseAppConfig import BaseAppConfig
  4. @register_deserializable
  5. class AppConfig(BaseAppConfig):
  6. """
  7. Config to initialize an embedchain custom `App` instance, with extra config options.
  8. """
  9. def __init__(
  10. self,
  11. log_level: str = "WARNING",
  12. id: Optional[str] = None,
  13. collect_metrics: Optional[bool] = None,
  14. collection_name: Optional[str] = None,
  15. ):
  16. """
  17. Initializes a configuration class instance for an App. This is the simplest form of an embedchain app.
  18. Most of the configuration is done in the `App` class itself.
  19. :param log_level: Debug level ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], defaults to "WARNING"
  20. :type log_level: str, optional
  21. :param id: ID of the app. Document metadata will have this id., defaults to None
  22. :type id: Optional[str], optional
  23. :param collect_metrics: Send anonymous telemetry to improve embedchain, defaults to True
  24. :type collect_metrics: Optional[bool], optional
  25. :param collection_name: Default collection name. It's recommended to use app.db.set_collection_name() instead,
  26. defaults to None
  27. :type collection_name: Optional[str], optional
  28. """
  29. super().__init__(log_level=log_level, id=id, collect_metrics=collect_metrics, collection_name=collection_name)