continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
18.2k stars 1.45k forks source link

Auto-completion will not be triggered within parentheses #1907

Open Tspm1eca opened 2 months ago

Tspm1eca commented 2 months ago

Before submitting your bug report

Relevant environment info

- OS: Windows 10
- Continue: 2024-08-03,
- IDE: Vscode
- Model: deepseek-coder API
- config.json:

  "tabAutocompleteOptions": {
    "template": "Please teach me what I should write in the `hole` tag, but without any further explanation and code backticks, i.e., as if you are directly outputting to a code editor. It can be codes or comments or strings. Don't provide existing & repetitive codes. If the provided prefix and suffix contain incomplete code and statement, your response should be able to be directly concatenated to the provided prefix and suffix. Also note that I may tell you what I'd like to write inside comments. \n{{{prefix}}}<hole></hole>{{{suffix}}}\n\nPlease be aware of the environment the hole is placed, e.g., inside strings or comments or code blocks, and please don't wrap your response in . You should always provide non-empty output.\n",
    "useCache": true,
    "maxPromptTokens": 2048
  },
  "tabAutocompleteModel": {
    "title": "DeepSeek-V2",
    "model": "deepseek-coder",
    "apiKey": "sk-xxxx",
    "contextLength": 8192,
    "apiBase": "https://api.deepseek.com",
    "completionOptions": {
      "maxTokens": 4096,
      "temperature": 0,
      "topP": 1,
      "presencePenalty": 0,
      "frequencyPenalty": 0
    },
    "provider": "deepseek",
    "useLegacyCompletionsEndpoint": false
  }

Description

a = {"A":1, "B":2, "C":3,  } #  No auto-completion after the comma.

To reproduce

No response

Log output

No response

fry69 commented 2 months ago

Using Codestral API I see autocompletion after typing the comma inside the closed }, see image. So this problem is limited to your setup and/or DeepSeek (note that autocompletion support is fresh and beta in DeepSeek), this is not a general problem with Continue (as your title suggests).

autocomplete
Tspm1eca commented 2 months ago

Using Codestral API I see autocompletion after typing the comma inside the closed }, see image. So this problem is limited to your setup and/or DeepSeek (note that autocompletion support is fresh and beta in DeepSeek), this is not a general problem with Continue (as your title suggests).

autocomplete

I submit this issue because I tried other projects that also use the DeepSeek API, and the auto-completion works very well in those projects.

I don't know if that project was specifically optimized for Deepseek, but it works fine. So, Deepseek should be capable of doing it.

Project address: Override

fry69 commented 2 months ago

I can see no special treatment for DeepSeek in the autocomplete part of Continue, except for necessary template -> https://github.com/search?q=repo%3Acontinuedev%2Fcontinue+path%3A%2F%5Ecore%5C%2Fautocomplete%5C%2F%2F+deepseek&type=code

And since completion inside (curly) parentheses works, as shown above, I suspect that either your context may have been "poisoned", or that the template that you forcefully set may mess things up.

Can you please try again with removing the template property from tabAutocompleteOptions inside config.json?