AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Disable `ask_user` for testing or benchmarking runs
Reinier van der Leer055bbc10d480
diff --git a/agbenchmark/benchmarks.py b/agbenchmark/benchmarks.pyindex ff8ab87742..bf5ff2567f 100644--- a/agbenchmark/benchmarks.py+++ b/agbenchmark/benchmarks.py@@ -25,6 +25,7 @@ def bootstrap_agent(task: str, continuous_mode: bool) -> Agent:config.debug_mode = Trueconfig.continuous_mode = continuous_modeconfig.temperature = 0+ config.noninteractive_mode = Trueconfig.plain_output = Trueconfig.memory_backend = "no_memory"config.workspace_path = Workspace.init_workspace_directory(config)diff --git a/autogpt/commands/user_interaction.py b/autogpt/commands/user_interaction.pyindex d5fa38db42..484150fb50 100644--- a/autogpt/commands/user_interaction.py+++ b/autogpt/commands/user_interaction.py@@ -23,6 +23,7 @@ from autogpt.command_decorator import command"required": True,}},+ enabled=lambda config: not config.noninteractive_mode)def ask_user(question: str, agent: Agent) -> str:resp = clean_input(agent.config, f"{agent.ai_config.ai_name} asks: '{question}': ")diff --git a/autogpt/config/config.py b/autogpt/config/config.pyindex 93fc42e914..f47c22c37b 100644--- a/autogpt/config/config.py+++ b/autogpt/config/config.py@@ -37,6 +37,7 @@ class Config(SystemSettings, arbitrary_types_allowed=True):exit_key: str = "n"debug_mode: bool = Falseplain_output: bool = False+ noninteractive_mode: bool = Falsechat_messages_enabled: bool = True# TTS configurationspeak_mode: bool = Falsediff --git a/tests/conftest.py b/tests/conftest.pyindex 55a1a4e3fa..0631ee50f1 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -57,6 +57,7 @@ def config(config.plugins_dir = "tests/unit/data/test_plugins"config.plugins_config_file = temp_plugins_config_file+ config.noninteractive_mode = Trueconfig.plain_output = True# avoid circular dependency