mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-02-08 07:44:22 +01:00
Enabling/disabling none/all of plugins from .env file (#4036)
Co-authored-by: Nicholas Tindle <nick@ntindle.com> Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ee98641210
commit
ccc03c1a8d
@@ -262,10 +262,14 @@ def denylist_allowlist_check(plugin_name: str, cfg: Config) -> bool:
|
||||
True or False
|
||||
"""
|
||||
logger.debug(f"Checking if plugin {plugin_name} should be loaded")
|
||||
if plugin_name in cfg.plugins_denylist:
|
||||
if (
|
||||
plugin_name in cfg.plugins_denylist
|
||||
or "all" in cfg.plugins_denylist
|
||||
or "none" in cfg.plugins_allowlist
|
||||
):
|
||||
logger.debug(f"Not loading plugin {plugin_name} as it was in the denylist.")
|
||||
return False
|
||||
if plugin_name in cfg.plugins_allowlist:
|
||||
if plugin_name in cfg.plugins_allowlist or "all" in cfg.plugins_allowlist:
|
||||
logger.debug(f"Loading plugin {plugin_name} as it was in the allowlist.")
|
||||
return True
|
||||
ack = input(
|
||||
|
||||
Reference in New Issue
Block a user