diff --git a/src/langbot/pkg/platform/botmgr.py b/src/langbot/pkg/platform/botmgr.py index f9907b84..7daa1067 100644 --- a/src/langbot/pkg/platform/botmgr.py +++ b/src/langbot/pkg/platform/botmgr.py @@ -241,12 +241,22 @@ class PlatformManager: # delete all bot log images await self.ap.storage_mgr.storage_provider.delete_dir_recursive('bot_log_images') + disabled_adapters = self.ap.instance_config.data.get('system', {}).get('disabled_adapters', []) or [] + self.adapter_components = self.ap.discover.get_components_by_kind('MessagePlatformAdapter') adapter_dict: dict[str, type[abstract_platform_adapter.AbstractMessagePlatformAdapter]] = {} for component in self.adapter_components: + if component.metadata.name in disabled_adapters: + continue adapter_dict[component.metadata.name] = component.get_python_component_class() self.adapter_dict = adapter_dict + # Filter out disabled adapters from components list (for API responses) + if disabled_adapters: + self.adapter_components = [ + c for c in self.adapter_components if c.metadata.name not in disabled_adapters + ] + # initialize websocket adapter websocket_adapter_class = self.adapter_dict['websocket'] websocket_logger = EventLogger(name='websocket-adapter', ap=self.ap) diff --git a/src/langbot/templates/config.yaml b/src/langbot/templates/config.yaml index c622405d..7b7e59fe 100644 --- a/src/langbot/templates/config.yaml +++ b/src/langbot/templates/config.yaml @@ -20,6 +20,7 @@ system: edition: community recovery_key: '' allow_modify_login_info: true + disabled_adapters: [] limitation: max_bots: -1 max_pipelines: -1