AutoGPT
AutoGPT copied to clipboard
Rename write_to_file to create_new_file to prevent misunderstanding
Background
GPT really struggles with attempting to write to files which already exist. Most of the time it attempts to write the same file over and over, ignoring the error.
Changes
This change renames the command from 'write_file' to 'create_new_file' so as to discourage the model from assuming that it will work as an append. Sometimes this is still not sufficient, so the error message is changed to be in all caps and look more like a system error message. This seems to work to get it to react to the file's existence.
Documentation
This just renames an existing method and changes some error text. All similarly named methods and aliases are updated.
Test Plan
I have tested it on multiple research focused prompts and this is a significant improvement.
PR Quality Checklist
- [x] My pull request is atomic and focuses on a single change.
- [x] I have thoroughly tested my changes with multiple different prompts.
- [x] I have considered potential risks and mitigations for my changes.
- [x] I have documented my changes clearly and comprehensively.
- [x] I have not snuck in any "extra" small tweaks changes
There are conflicts.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Can we also have a update_file
command? It would be super helpful if the PLAN displayed a preview of the file as NEXT_ACTION displays it all in one line with \\n
I don't think this is the right approach. Check out #1891