mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
Merge pull request #133 from prestoj/human-feedback-in-manual-mode
human feedback in manual mode
This commit is contained in:
@@ -311,7 +311,7 @@ while True:
|
|||||||
Fore.CYAN,
|
Fore.CYAN,
|
||||||
f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}")
|
f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}")
|
||||||
print(
|
print(
|
||||||
"Enter 'y' to authorise command or 'n' to exit program...",
|
f"Enter 'y' to authorise command or 'n' to exit program, or enter feedback for {ai_name}...",
|
||||||
flush=True)
|
flush=True)
|
||||||
while True:
|
while True:
|
||||||
console_input = input(Fore.MAGENTA + "Input:" + Style.RESET_ALL)
|
console_input = input(Fore.MAGENTA + "Input:" + Style.RESET_ALL)
|
||||||
@@ -322,16 +322,18 @@ while True:
|
|||||||
user_input = "EXIT"
|
user_input = "EXIT"
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
continue
|
user_input = console_input
|
||||||
|
command_name = "human_feedback"
|
||||||
|
break
|
||||||
|
|
||||||
if user_input != "GENERATE NEXT COMMAND JSON":
|
if user_input == "GENERATE NEXT COMMAND JSON":
|
||||||
print("Exiting...", flush=True)
|
print_to_console(
|
||||||
break
|
|
||||||
|
|
||||||
print_to_console(
|
|
||||||
"-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-=",
|
"-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-=",
|
||||||
Fore.MAGENTA,
|
Fore.MAGENTA,
|
||||||
"")
|
"")
|
||||||
|
elif user_input == "EXIT":
|
||||||
|
print("Exiting...", flush=True)
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
# Print command
|
# Print command
|
||||||
print_to_console(
|
print_to_console(
|
||||||
@@ -340,10 +342,12 @@ while True:
|
|||||||
f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}")
|
f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}")
|
||||||
|
|
||||||
# Execute command
|
# Execute command
|
||||||
if command_name.lower() != "error":
|
if command_name.lower() == "error":
|
||||||
result = f"Command {command_name} returned: {cmd.execute_command(command_name, arguments)}"
|
|
||||||
else:
|
|
||||||
result = f"Command {command_name} threw the following error: " + arguments
|
result = f"Command {command_name} threw the following error: " + arguments
|
||||||
|
elif command_name == "human_feedback":
|
||||||
|
result = f"Human feedback: {user_input}"
|
||||||
|
else:
|
||||||
|
result = f"Command {command_name} returned: {cmd.execute_command(command_name, arguments)}"
|
||||||
|
|
||||||
# Check if there's a result from the command append it to the message
|
# Check if there's a result from the command append it to the message
|
||||||
# history
|
# history
|
||||||
@@ -355,3 +359,4 @@ while True:
|
|||||||
chat.create_chat_message(
|
chat.create_chat_message(
|
||||||
"system", "Unable to execute command"))
|
"system", "Unable to execute command"))
|
||||||
print_to_console("SYSTEM: ", Fore.YELLOW, "Unable to execute command")
|
print_to_console("SYSTEM: ", Fore.YELLOW, "Unable to execute command")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user