Skip to content

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.

changed rstrip for strip and added case for empty string

Manuel Otheo286edbbb8cb6
diff --git a/autogpt/agent/agent.py b/autogpt/agent/agent.py
index dca614c7f2..89ea2c8c4c 100644
--- a/autogpt/agent/agent.py
+++ b/autogpt/agent/agent.py
@@ -115,9 +115,12 @@ class Agent:
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(