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

support for unified diff or git diff format #1

Open
unicomp21 opened this issue Jul 30, 2023 · 13 comments
Open

support for unified diff or git diff format #1

unicomp21 opened this issue Jul 30, 2023 · 13 comments

Comments

@unicomp21
Copy link

otherwise we burn large token counts when doing large refactors?

@ValentaTomas
Copy link
Member

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?

@unicomp21
Copy link
Author

yes

@unicomp21
Copy link
Author

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)

@ValentaTomas
Copy link
Member

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

@unicomp21
Copy link
Author

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?

@ValentaTomas
Copy link
Member

ValentaTomas commented Jul 31, 2023

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.

@unicomp21
Copy link
Author

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"
}
]
}

@unicomp21
Copy link
Author

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

@unicomp21
Copy link
Author

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

@ValentaTomas
Copy link
Member

ValentaTomas commented Aug 1, 2023

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.

@unicomp21
Copy link
Author

unicomp21 commented Aug 1, 2023 via email

@ValentaTomas
Copy link
Member

ValentaTomas commented Aug 1, 2023

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

@JacobFV
Copy link
Contributor

JacobFV commented Aug 5, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants