Skip to content

Commit

Permalink
Filtering out ANSI escape codes in printed assistant thoughts (#4812)
Browse files Browse the repository at this point in the history
Co-authored-by: uta <122957026+uta0x89@users.noreply.github.com>
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
Co-authored-by: lukas-eu <62448426+lukas-eu@users.noreply.github.com>
  • Loading branch information
4 people authored Jun 27, 2023
1 parent 5d5a35e commit ebe1861
Show file tree
Hide file tree
Showing 17 changed files with 445 additions and 329 deletions.
4 changes: 2 additions & 2 deletions autogpt/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
USER_INPUT_FILE_NAME,
LogCycleHandler,
)
from autogpt.logs import logger, print_assistant_thoughts
from autogpt.logs import logger, print_assistant_thoughts, remove_ansi_escape
from autogpt.memory.message_history import MessageHistory
from autogpt.memory.vector import VectorMemory
from autogpt.models.command_registry import CommandRegistry
Expand Down Expand Up @@ -185,7 +185,7 @@ def signal_handler(signum, frame):
logger.typewriter_log(
"NEXT ACTION: ",
Fore.CYAN,
f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} "
f"COMMAND = {Fore.CYAN}{remove_ansi_escape(command_name)}{Style.RESET_ALL} "
f"ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}",
)

Expand Down
Loading

0 comments on commit ebe1861

Please sign in to comment.