e2b-dev/llm-code-interpreter

support for unified diff or git diff format

unicomp21 opened this issue · 13 comments

otherwise we burn large token counts when doing large refactors?

Hi @unicomp21, if I understand correctly you want an alternative to the "WriteFile" operation that is not writing the whole file every time, but just applies the edits in some diff format?

yes

I'm kinda wondering if "language server protocol" might be useful here as well? (ie deno lsp, typescript lsp, might also help drive down token counts during refactor operations)

I understand, maybe there is something there. We have been actually running language servers in these envs in the past, but for other reasons.

Looking at unified diff in openai evals, looks like we need a different/simpler approach for handling code deltas? I wonder if gpt-4 could supply simple search/replace string? along w/ target filename?

You can probably start experimenting with it right now - tell it to use RunProcess to modify files by executing commands that apply the diffs. Then we can see if it can handle it somehow.

Will do, I just applied for developer access to chat plugins, I'm on the waitlist.

I've been experimenting w/ this problem of eliminating cut/paste for a while. Here's an old eval of mine.
openai/evals#771

Starting to think sed w/ search/replace might be the simplest/reliable way for handling deltas.

using the new "custom instructions", this seems to work nicely, gpt-4 appears to be comfortable base64 encoding the deltas.

{
"deltas": [
{
"type": "code_diff",
"search_string": "cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==",
"replace_string": "cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQoKcHJpbnQoIkdvb2RieWUhIik=",
"file_path": "main.py"
}
]
}

Lol, I look forward to a setup w/ zero cut/paste. I'm lazy !!!

@ValentaTomas how long of a wait does it take on the plugins developer waitlist?

I don't really know.

We actually don't have and developer access to plugins and developed this with the help of the community by remotely debugging it.

We just talked with some folks and they gave us remote control access to their computer and we were testing the extension that way.

Looking at unified diff in openai evals, looks like we need a different/simpler approach for handling code deltas? I wonder if gpt-4 could supply simple search/replace string? along w/ target filename?

This seems to be the way cursor.so does it