Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
MIT License
165.83k stars 43.95k forks source link

Add command for editing files in place #727

Closed loliverhennigh closed 11 months ago

loliverhennigh commented 1 year ago

Duplicates

Summary 💡

Currently Auto-GPT writes the entire python or text file at once. If the file gets beyond a few paragraphs this starts to cause issues often time causing json parsing error. Could we somehow have it insert text into an existing file. Maybe we can have it give vim commands to edit it.

Been running a benchmark of having it write a fluid simulation using the lattice boltzmann method. Been running this everyday for a week or so to see the progress of Auto-GPT developments. I think it is very close to working but need this one last bit of functionality.

Examples 🌈

Here is an example that I think shows gpt is capable of doing it. Screenshot from 2023-04-10 12-03-14

Screenshot from 2023-04-10 12-02-52

Motivation 🔦

This would allow for Auto-GPT to modify and improve itself

Boostrix commented 1 year ago

This would allow for Auto-GPT to modify and improve itself: https://github.com/Significant-Gravitas/Auto-GPT/issues/15

I have seen it using sed/awk successfully - but it does help to update its constraints to prefer CLI line editors. Also, like you said, the invalid JSON issue is more likely once the file to be modified becomes larger. I tried to make it work off diff/patches, but that breaks currently because those are using hashes to reference local files, so one would probably need a new mode to create/edit a diff and use CLI tools to update the hash portion, and only let the LLM handle the rest, i.e. coming up with code.

For the time being, changes that are spanning multiple files but that are conceptually related (as in adding new commands/actions to Auto-GPT), is hitting too many hard-coded constraints - not to mention the contex window restriction

See: https://github.com/Significant-Gravitas/Auto-GPT/pull/3643

github-actions[bot] commented 11 months ago

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