🔧 chore(settings.py): add support for custom components in the settings

 feat(settings.py): allow updating custom components in the settings
The `custom_components` attribute has been added to the `Settings` class to support custom components in the application. This allows users to define and use their own components in addition to the built-in ones. The `update_settings` method has been updated to include the `custom_components` attribute when updating the settings. This change improves the flexibility and extensibility of the application.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-06 23:52:43 -03:00
commit a29b83e4fa

View file

@ -21,6 +21,8 @@ class Settings(BaseSettings):
textsplitters: dict = {}
utilities: dict = {}
output_parsers: dict = {}
custom_components: dict = {}
dev: bool = False
database_url: str
cache: str = "InMemoryCache"
@ -66,6 +68,7 @@ class Settings(BaseSettings):
self.documentloaders = new_settings.documentloaders or {}
self.retrievers = new_settings.retrievers or {}
self.output_parsers = new_settings.output_parsers or {}
self.custom_components = new_settings.custom_components or {}
self.dev = dev
def update_settings(self, **kwargs):