AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

.env or startup parameter to exclude commands / programs from being used

Open bassie661 opened this issue 1 year ago • 2 comments

Duplicates

  • [X] I have searched the existing issues

Summary 💡

I encounter some problems with autogpt getting stuck when it decides to write or append a file using GUI programs like “nano” or “vi”.

As soon as it startsup nano and try to do its thing, it seems to stall.

At that point the only way to get it out of this waiting loop is to go into a second terminal and kill the nano program with the “killall nano” command.

To get arround this I tried to forbid autogpt to use applications like “nano” by telling it in the initial goal, at the start, but that didn't seem to work as of now.

It would be nice if we could set a parameter to let autogpt know which applications it’s allowed to use to reach it’s goals and which applications it's not allowed.

Examples 🌈

No response

Motivation 🔦

No response

bassie661 avatar Apr 24 '23 23:04 bassie661

I don't know why you would need a script to use nano, text editors are made for humans to interface with words, not machines. It would be much better to tell it to use echo, but again I don't know the surrounding circumstances here

JPDucky avatar Apr 25 '23 20:04 JPDucky

I think I got a working situation now, I added the below constraints to \autogpt\prompts\prompt.py

prompt_generator.add_constraint( "Do not edit the files, instead read the content from the file, delete the" " file and recreate it with the updated content." ) prompt_generator.add_constraint( 'Do not use any editing programs such as "nano", "vim" or "gedit", instead' ' use command line to edit files with "write_to_file" or "append_to_file".' )

And it seems the agent now respects these constraints. So hopefully that's it.

bassie661 avatar Apr 25 '23 21:04 bassie661

We might be able to fix this in the execute_shell implementation

Pwuts avatar Apr 26 '23 21:04 Pwuts

That would be awesome, it might also have to-do with autogpt seeking a way to deal with the limited return it gets from the search_files() function, it would make sense that it starts to look for all kinds of ways like "vi" and "nano". I mean if it thinks the file it created doesn't exist, or it cannot find the file every time, that it eventually turns to "nano".

But the option to exclude would be good in anyway.

bassie661 avatar Apr 26 '23 22:04 bassie661

Duplicate of #1327

Pwuts avatar Apr 26 '23 22:04 Pwuts