#11

Edit tool?

Openadityamiskinopened 9mo ago

Is there a plan to introduce an Edit tool as well anytime soon?

Activity

3
cramforce9mo ago

Sorry for the slow reply. Could be added for sure. I'd need to research the common signature. Is it basically content, starting line, number of lines?

adityamiskin8mo ago

There are 3 ways to go about the edit tool rn

  1. Line-Number based edits - path of file, start_line, end_line, replacement_text
  2. Git diff patch - one single git diff patch
  3. Str find and replace - path of file, old_str(must match exactly) , new_str, replace_all(optional)

I think that find and replace would be a better choice bcuz line numbers can change drastically and will change continuously as the agent makes edits. This would require re-reading the file again and again. Also there are chances of bad edits bcuz there is no failure point before the edit actually happens. In str_find_and_replace, there is a early failure point which is basically that the agent is supposed to write the exact old_str, if that doesnt happen, the edit fails.

I havent worked with git diff patch much, but researching around it. What do you think?

cramforce8mo ago

Ship it. Please send a PR