-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improves the relevance of codestral completion #18
Conversation
Probably this could indeed help, although when typing it's common to go back, delete a few characters, type new ones. So not sure if it really helps in practice? Also wondering if this may be adding additional complexity to the inline completer logic to work around the slow response time from the Mistral API? Maybe it's already a bit faster with other providers? |
I agree that it may not often be useful, it only avoid fetching again the completion if the previous one includes the changes...
The complexity is mostly added to the codestral completer, it should not be ported to other completers if not required. |
I forgot to mention that it also adds a timeout of 3s, and fetch again if there is no respond in this delay. This is to avoid some infinite waiting from server. |
@jtpio should we move forward with this PR ? The changes from this PR would still avoid displaying outdated suggestions, even if the suggestion can take a long time to be available. |
Ah yes, maybe it can be a good tradeoff for now for getting that one in. Also if this change is just for the Mistral completion we could indeed get this in, if it already improves the current behavior. |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Let's get this in as this should already improve the current situation.
This PR try to improve the relevance of code completion using codestral.
Should fix #16
Context
Codestral allows only one request per second, and a completion request may takes about 2 sec.
This can lead to inconsistency between the suggestion and the current prompt, which may have change during the request.
Code change
The completion provider keep in memory the latest prompt if the a request is pending.
When the suggestion is received, there are 3 possible situations:
def te
and the current prompt isdef test
.The completion may take more time to be display, but should be more relevant.
Additionally, the options
Debouncer delay
in the inline completion settings should be used, to add a delay before fetching the completion after the last key has been pressed.EDIT: I forgot to mention that it also adds a timeout of 3s, and fetch again if there is no respond in this delay. This is to avoid some infinite waiting from server.