From c5accc6904609b487bb22823a8699859e962dced Mon Sep 17 00:00:00 2001 From: Krzysztof Czerwinski Date: Sat, 9 Mar 2024 14:33:46 +0100 Subject: [PATCH] Loop until task is provided --- autogpts/autogpt/autogpt/app/main.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/autogpts/autogpt/autogpt/app/main.py b/autogpts/autogpt/autogpt/app/main.py index 47908a3addb6..b68f848a53e7 100644 --- a/autogpts/autogpt/autogpt/app/main.py +++ b/autogpts/autogpt/autogpt/app/main.py @@ -230,11 +230,14 @@ async def run_auto_gpt( # Set up a new Agent # ###################### if not agent: - task = await clean_input( - config, - "Enter the task that you want AutoGPT to execute," - " with as much detail as possible:", - ) + task = "" + while task.strip() == "": + task = await clean_input( + config, + "Enter the task that you want AutoGPT to execute," + " with as much detail as possible:", + ) + base_ai_directives = AIDirectives.from_file(config.prompt_settings_file) ai_profile, task_oriented_ai_directives = await generate_agent_profile_for_task(