Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reliably edit file without repeating the entire contents #18

Open
sestinj opened this issue Sep 4, 2023 · 0 comments
Open

Reliably edit file without repeating the entire contents #18

sestinj opened this issue Sep 4, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@sestinj
Copy link
Contributor

sestinj commented Sep 4, 2023

The current prompt for editing files requires the LLM to rewrite the entire range that it wants to edit. Ideally, it could specify only the diff, or at most a few lines surrounding the areas that it wants to edit.

To see the start of one attempt at this, look here. One idea on how to do this is by getting the LLM to output git merge conflict notation, like this:

<<<<<<< HEAD
<OLD_CODE>
=======
<NEW_CODE>
>>>>>>> updated

Other ideas:

  • Fine-tune a model to generate a git diff
  • Get the model to quote parts of the range it wants to edit
  • Give the model tools like "insert here", "delete here", or "find and replace"
@sestinj sestinj added the enhancement New feature or request label Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant