OpenSourceAppConfig.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. from typing import Optional
  2. from embedchain.helper_classes.json_serializable import register_deserializable
  3. from .BaseAppConfig import BaseAppConfig
  4. @register_deserializable
  5. class OpenSourceAppConfig(BaseAppConfig):
  6. """
  7. Config to initialize an embedchain custom `OpenSourceApp` instance, with extra config options.
  8. """
  9. def __init__(
  10. self,
  11. log_level=None,
  12. id=None,
  13. collect_metrics: Optional[bool] = None,
  14. model=None,
  15. collection_name: Optional[str] = None,
  16. ):
  17. """
  18. :param log_level: Optional. (String) Debug level
  19. ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'].
  20. :param id: Optional. ID of the app. Document metadata will have this id.
  21. :param collect_metrics: Defaults to True. Send anonymous telemetry to improve embedchain.
  22. :param model: Optional. GPT4ALL uses the model to instantiate the class.
  23. So unlike `App`, it has to be provided before querying.
  24. :param collection_name: Optional. Default collection name.
  25. It's recommended to use app.db.set_collection_name() instead.
  26. """
  27. self.model = model or "orca-mini-3b.ggmlv3.q4_0.bin"
  28. super().__init__(log_level=log_level, id=id, collect_metrics=collect_metrics, collection_name=collection_name)