Improve apply_diff tool for better efficiency and reliability #7062
DaveScream
started this conversation in
Feature Requests
Replies: 1 comment
-
Why not? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I would like to propose an improvement to the apply_diff tool. Currently, I've noticed a few issues with its functionality:
To address these issues, I suggest redesigning the tool to allow the model to directly specify the file and line numbers for the code that needs to be replaced, along with the new content. For example, it could specify replacing 6 lines 30-35 with null content (a deletion), or replacing lines 30-31 with 30 new lines of content (code expansion). This would be much more efficient and reliable.
Here is an example of the proposed syntax:
Then, on the client-side, this could be converted into the full apply_diff format for display in VS Code. The client would be responsible for fetching the content of the specified lines from the file and pasting it to the 'search' block, while the 'replace' block would be taken with the content provided by the model.
This approach would prevent the model from having to reproduce the old code and would likely lead to a more robust and efficient implementation of the
apply_diff
tool.Thank you for your consideration.
Beta Was this translation helpful? Give feedback.
All reactions