-
Notifications
You must be signed in to change notification settings - Fork 240
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
O1 parsing code replace fix #686
base: main
Are you sure you want to change the base?
Conversation
Hello, avante.nvim has refactored the prompt and is now using aider's prompt. It will no longer rely on line numbers returned by LLM, so it seems this issue won't occur anymore. You can try updating and testing it. |
Awesome I saw the new change and it's great architecture wise :) To fix this, I think the best option is either to change the "on_chunk" function to handle non-streaming requests (the function fails to work in the openai "parse_response_without_stream" function), or to separate the searching/replacing from the "on_chunk" itself, and allowing it to work both during streaming and non streaming - in the same place in the code. I will try to work on one of the options now to let the O1 models I use work with it fluently too, will update on progress :) |
@yetone if is_first_chunk then
is_first_chunk = false
self:update_content(content_prefix .. chunk, { stream = false, scroll = true })
return Since O1 models give a result it one chunk, this code was just returning the content without replacing the relevant lines for parsing. I've basically removed this as this doesn't affect the Claude and other streaming models and provides the ability to work with O1 models as they are meant too. |
3a79dc7
to
5c02a5d
Compare
I've fixed the new version of the code to work with O1 models. The fix doesn't interfere with other functionality of different models/providers from my tests :) |
O1 models sometimes return the following format when marking lines to replaces:
This format doesn't allow completion to work correctly, so I've added a fix that clears the current line to parse the "Replace Lines" correctly on O1 models too.
Since the new code only cleans the
**
and`
characters -> it still works as expected with Claude and all other models.