aider icon indicating copy to clipboard operation
aider copied to clipboard

Instead of SEARCH/REPLACE, just output the new file

Open ackoi opened this issue 1 year ago • 3 comments

Issue

Just an idea and I could be missing something, but is there a reason why smaller files wouldn't just have only the updated new file content requested in the output instead of doing a SEARCH/REPLACE which spends a lot more tokens?

If the necessary changes require changing a large of a file, you can just request a full rewrite to be the output instead.

I've mostly been working this way when using 3.5 Sonnet outside of Aider and it seems to work pretty well.

Version and model info

No response

ackoi avatar Jul 03 '24 13:07 ackoi

Thanks for trying aider and filing this issue.

You could try using --edit-format whole for this.

paul-gauthier avatar Jul 03 '24 14:07 paul-gauthier

Thanks for trying aider and filing this issue.

You could try using --edit-format whole for this.

I should've read the docs better!

What do you think about having the option to let Sonnet choose which format to use depending on how much needs to be changed?

ackoi avatar Jul 04 '24 21:07 ackoi

I have another idea. What if there was an option for the model to provide its response in a human-readable format, describing the necessary code changes instead of using the diff format? Then, a more cost-effective model, such as Claude Haiku or Gemini Flash, could generate the diff from this description. Alternatively, we could fine-tune a model specifically for this purpose. What do you think?

razorback16 avatar Jul 09 '24 17:07 razorback16

I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.

paul-gauthier avatar Jul 22 '24 06:07 paul-gauthier