AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Check if file exists before creating new file

Open nalbion opened this issue 1 year ago • 3 comments

Duplicates

  • [X] I have searched the existing issues

Summary 💡

When the goal mentions a that a "my-script.js should be ..." (for some purpose) Auto-GPT is too eager to touch my-script.js and then later fails on write_to_file (as I mentioned in #3076), or write_to_file with just the new requirements.

I have to prompt it:

You will not write_to_file. You will ingest the existing file and update it as necessary

...and some times it's able to use append_to_file instead, or I may need to quickly delete the record in file_logger.txt to allow the write_to_file once it incorporates the changes into the existing file.

Examples 🌈

No response

Motivation 🔦

This would make Auto-GPT much more useful to work with existing files.

nalbion avatar Apr 24 '23 01:04 nalbion

This may be a limit of the LLM. It would be hard to coax it into checking for existing files beforehand outside of the user prompt. We could supply chatGPT with the results of an LS call with the initial prompt, or perhaps store created files more clearly in short term memory?

rocks6 avatar Apr 24 '23 02:04 rocks6

Would the API be able to throw an exception or return a code to feed back a hint to the LLM that it should edit the file (unless it's already in the desired state)? This is currently what I end up doing through reprompting the LLM

nalbion avatar Apr 24 '23 03:04 nalbion

good question, this is a restriction that I ran into, too: the current command manager/system doesn't seem to be designed to return more than the result of action, i.e. error codes/exceptions etc

Regardig #3076, see #3643

Boostrix avatar May 10 '23 17:05 Boostrix

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

github-actions[bot] avatar Sep 06 '23 21:09 github-actions[bot]

This issue was closed automatically because it has been stale for 10 days with no activity.

github-actions[bot] avatar Sep 18 '23 01:09 github-actions[bot]