From 233f900fa6dff98ef935314d7a062ecc5a4dc0ac Mon Sep 17 00:00:00 2001 From: Marwand Ayubi <98717667+xhypeDE@users.noreply.github.com> Date: Sat, 13 May 2023 17:21:16 +0200 Subject: [PATCH] Implemented showing the number of preauthorised commands left. #1035 (#3322) Co-authored-by: mayubi Co-authored-by: Nicholas Tindle Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com> --- autogpt/agent/agent.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/autogpt/agent/agent.py b/autogpt/agent/agent.py index 75f51dc1..4db9e2ee 100644 --- a/autogpt/agent/agent.py +++ b/autogpt/agent/agent.py @@ -149,18 +149,18 @@ class Agent: NEXT_ACTION_FILE_NAME, ) + logger.typewriter_log( + "NEXT ACTION: ", + Fore.CYAN, + f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} " + f"ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}", + ) + if not cfg.continuous_mode and self.next_action_count == 0: # ### GET USER AUTHORIZATION TO EXECUTE COMMAND ### # Get key press: Prompt the user to press enter to continue or escape # to exit self.user_input = "" - logger.typewriter_log( - "NEXT ACTION: ", - Fore.CYAN, - f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} " - f"ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}", - ) - logger.info( "Enter 'y' to authorise command, 'y -N' to run N continuous commands, 's' to run self-feedback commands, " "'n' to exit program, or enter feedback for " @@ -235,12 +235,9 @@ class Agent: logger.info("Exiting...") break else: - # Print command + # Print authorized commands left value logger.typewriter_log( - "NEXT ACTION: ", - Fore.CYAN, - f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL}" - f" ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}", + f"{Fore.CYAN}AUTHORISED COMMANDS LEFT: {Style.RESET_ALL}{self.next_action_count}" ) # Execute command