AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Rename write_to_file to create_new_file to prevent misunderstanding

Open tkaitchuck opened this issue 1 year ago • 3 comments

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

tkaitchuck avatar Apr 17 '23 02:04 tkaitchuck

There are conflicts.

AndresCdo avatar Apr 17 '23 07:04 AndresCdo

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 17 '23 16:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 17 '23 16:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 17 '23 22:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 19 '23 23:04 github-actions[bot]

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

nalbion avatar Apr 24 '23 01:04 nalbion

I don't think this is the right approach. Check out #1891

Pwuts avatar Apr 26 '23 21:04 Pwuts