app_config.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. from typing import Optional
  2. from embedchain.helpers.json_serializable import register_deserializable
  3. from .base_app_config 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. name: Optional[str] = None,
  14. collect_metrics: Optional[bool] = True,
  15. **kwargs,
  16. ):
  17. """
  18. Initializes a configuration class instance for an App. This is the simplest form of an embedchain app.
  19. Most of the configuration is done in the `App` class itself.
  20. :param log_level: Debug level ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], defaults to "WARNING"
  21. :type log_level: str, optional
  22. :param id: ID of the app. Document metadata will have this id., defaults to None
  23. :type id: Optional[str], optional
  24. :param collect_metrics: Send anonymous telemetry to improve embedchain, defaults to True
  25. :type collect_metrics: Optional[bool], optional
  26. """
  27. self.name = name
  28. super().__init__(log_level=log_level, id=id, collect_metrics=collect_metrics, **kwargs)