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.

Fix potential passing of NoneType to remove_ansi_escape (#4882)

Jamese4a337f1a5d6
diff --git a/autogpt/logs.py b/autogpt/logs.py
index 329afb8b96..9d99f274da 100644
--- a/autogpt/logs.py
+++ b/autogpt/logs.py
@@ -271,7 +271,7 @@ def print_assistant_thoughts(
assistant_thoughts_criticism = None
assistant_thoughts = assistant_reply_json_valid.get("thoughts", {})
- assistant_thoughts_text = remove_ansi_escape(assistant_thoughts.get("text"))
+ assistant_thoughts_text = remove_ansi_escape(assistant_thoughts.get("text", ""))
if assistant_thoughts:
assistant_thoughts_reasoning = remove_ansi_escape(
assistant_thoughts.get("reasoning")