Closed juanfradb closed 1 month ago
yah. And it just keeps running and runnning. Where does it end and how does it summarize all the findings up?
Add the following code to your babyagi.py file. It will turn the continuous mode off and prompt you at the end of each task to modify the task, proceed, or exit.
def user_interaction():
while True:
print("\033[96m\033[1m" + "\n*****USER INPUT*****\n" + "\033[0m\033[0m")
print("Select an option:")
print("1. Modify tasks")
print("2. Proceed")
print("3. Stop and exit")
user_input = input("Enter the number corresponding to your choice: ")
if user_input == "1":
return "modify_tasks"
elif user_input == "2":
return "proceed"
elif user_input == "3":
return "stop"
else:
print("Invalid input. Please enter a valid number.")
where do we put user_interaction() to use in the main code?
Add it before the Main Loop.
I forgot to mention to add the following section. You will also need to add the following code to the end of the Main Loop.
user_choice = user_interaction()
if user_choice == "modify_tasks":
new_task_name = input("Enter the new task to be added: ")
new_task = {
"task_id": tasks_storage.next_task_id(),
"task_name": new_task_name
}
tasks_storage.append(new_task)
prioritization_agent()
elif user_choice == "stop":
break
The whole last section should look like this.
Something akin to a "Pause" Button would be appreciated
It will be great if with a command or keyboard I can stop babyagi and provide some feedback