From 286edbbb8cb61e921e0315db8b506d6f7b1d6fce Mon Sep 17 00:00:00 2001 From: Manuel Otheo Date: Mon, 17 Apr 2023 09:17:07 -0600 Subject: [PATCH] changed rstrip for strip and added case for empty string changed rstrip for strip and added case for empty string in agent.py --- autogpt/agent/agent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autogpt/agent/agent.py b/autogpt/agent/agent.py index dca614c7f239..89ea2c8c4cbd 100644 --- a/autogpt/agent/agent.py +++ b/autogpt/agent/agent.py @@ -115,9 +115,12 @@ def start_interaction_loop(self): console_input = clean_input( Fore.MAGENTA + "Input:" + Style.RESET_ALL ) - if console_input.lower().rstrip() == "y": + if console_input.lower().strip() == "y": user_input = "GENERATE NEXT COMMAND JSON" break + elif console_input.lower().strip() == "": + print("Invalid input format.") + break elif console_input.lower().startswith("y -"): try: self.next_action_count = abs(