Closed davidpissarra closed 11 months ago
An example of the current issue follows (different prompts with every typed character arriving at the rest API, which is cumbersome):
Hello, thank you for opening this PR.
Two things:
async provideInlineCompletionItems(document, position, context, token) {
in your delay function?The plugin uses vscode.InlineCompletionItemProvider
to handle the triggering of fetching completions. It already has a mechanism to buffer keypresses and delay requests, but it doesn't seem configurable and has a pretty low threshold. Additionally, requests are cancelled every time a new request is sent, in a remote endpoint setup it seems to work well, but I can see why in local setups that wouldn't, given there is no network overhead.
This is definitely a great feature to have. For the time being, I am using a manual invocation shortcut to overcome this issue but this PR is a great way of resolving it.
Up, this really is a neat feature that will definitely help use local copilots. thanks @davidpissarra
This was done in https://github.com/huggingface/llm-vscode/pull/111, closing
This PR introduces the setting
llm.requestDelay
. It represents the minimum time interval between requests. This setting avoids unnecessary API calls, typically when the user is still typing. For instance, ifrequestDelay
is set to2
, the extension waits 2 seconds for something to be typed, otherwise makes an API call. Prior to this PR, every single character typed would result in a new call, overloading the API with many irrelevant requests, and most of the time making the user wait for all requests to be satisfied even if not needed anymore.