AutoGPT
AutoGPT copied to clipboard
A way to stop executing of "y -100" without killing the program
Duplicates
- [X] I have searched the existing issues
Summary 💡
I'd like to press some keyboard shortcut like "Ctrl-Y" (Not Ctrl-C to kill the process, not Ctrl-Z to background it.)
GPT-4 tells me that the keyboard module should work in Windows and Mac.
Example:
import keyboard
import time
pause = False
def toggle_pause(e):
global pause
# Check if the 'ctrl' modifier is pressed
if e.event_type == 'down' and keyboard.is_pressed('ctrl'):
pause = not pause
keyboard.suppress_event(e) # Suppress the key event if 'ctrl' is pressed
# Bind the 'y' key to the toggle_pause function
keyboard.on_press_key('y', toggle_pause)
print("Press Ctrl-Y to pause and resume the program.")
while True:
if not pause:
print("Running...")
else:
print("Paused...")
time.sleep(1)
(You have to be sudo to use "keyboard" unfortunately... Which seems like a bad idea. Also, it will break your venv to run as sudo.)
Maybe similar to:
- https://github.com/Torantulino/Auto-GPT/issues/954
- https://github.com/Torantulino/Auto-GPT/issues/123
Examples 🌈
Enter 'y' to authorise command, 'y -N' to run N continuous commands, 'n' to exit program, or enter feedback for AGI-GPT... Input:y -1000 ... (AutoGPT starts saying dumb things and it would be nice to give it feedback...) ... (Ctrl-Y) Ctrl-Y pressed. Stopping previous y -1000 Enter 'y' to authorise command, 'y -N' to run N continuous commands, 'n' to exit program, or enter feedback for AGI-GPT... Input: Don't say the things you were saying.
Motivation 🔦
Wasting OpenAI $$$ is terrible.
What's wrong with Ctrl-C ?
What's wrong with Ctrl-C ?
It stops the program completely and it has to restart from scratch. The brilliant idea suggested here allows for the code just to pause to receive input to consider, and continue from where it left off. Depending on where it is and on what task, Control C may flush hours of work down the drain just to start over again
I think it could be solved if the memory of the AI doesn't get wiped out every time you start the program. That way, CTRL+C wouldn't cause any problems and you will be able to shutdown the AI and then continue where you left off. But the code currently doesn't do that.
Related to #150
is there a working solution for the issue?
I think it could be solved if the memory of the AI doesn't get wiped out every time you start the program. That way, CTRL+C wouldn't cause any problems and you will be able to shutdown the AI and then continue where you left off. But the code currently doesn't do that. is there a working solution for the issue?
There seem to be at least 5+ different issues related to the underlying idea of being able to suspend/resume or terminate/restart execution of an agent/sub-agent while retaining at least some of its intermediate state: https://github.com/Significant-Gravitas/Auto-GPT/issues/3382#issuecomment-1529776848
Hi, just a short update - thanks for taking the time to update your PR, your PR was today discussed on Discord by several devs and it's being assigned to be reviewed right now!
So, given that there seem to be at least 5+ different PRs in the pipeline currently using similar but still a different method, it is likely that we're going to take parts from each and every one of these PRs, to ensure that the feature is well-aligned with the ongoing re-arch effort.
This means, you will end up in the credits automagically - but won't have to do any more work from now on.
If there are remaining questions, someone is going to contact you, the PR is being reviewed by @gravelBridge
Hello! Thank you so much for your contribution and feature suggestion! I have finished implementing our version of this feature here: https://github.com/Significant-Gravitas/Auto-GPT/pull/4230. Once again, thank you!
This was fixed in #4230. The feature works in 4.0.0. However, in the most recent stable releases, it has not worked.
if you've got access to autogpt 4.0, I would be willing to pay ...
Should be fixed again by #4997, which will be merged into master as a part of #4799. :')