deepseek-ai / awesome-deepseek-integration

Creative Commons Zero v1.0 Universal
632 stars 55 forks source link

不支持 vscode continue 插件的 TAB 自动代码补全功能 #9

Closed cadl closed 4 months ago

cadl commented 6 months ago

vscode continue 增加了 TAB 代码补全功能(beta)。我尝试给tabAutocompleteModel 设置 deepseek openai 兼容接口后,发现不能正常使用该功能:补全出来的是chat模式的文字而非代码。 看起来 api 版本的 deepseek-coder 模型不支持 fim。本地 ollama 跑 deepseek-coder:base 是可以的。

请问 api 能否开放支持 fim 的 deepseek-coder 模型?或是 api 提供一些可以支持代码补全的参数?

XieJiSS commented 4 months ago

FIM 功能未来将会直接支持,目前可以先使用如下 Continue.dev 配置:

{
  "models": [],
  "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": REDACTED,
    "contextLength": 8192,
    "apiBase": "https://api.deepseek.com",
    "completionOptions": {
      "maxTokens": 4096,
      "temperature": 0,
      "topP": 1,
      "presencePenalty": 0,
      "frequencyPenalty": 0
    },
    "provider": "openai",
    "useLegacyCompletionsEndpoint": false
  }
}
cadl commented 4 months ago

FIM 功能未来将会直接支持,目前可以先使用如下 Continue.dev 配置:

{
  "models": [],
  "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": REDACTED,
    "contextLength": 8192,
    "apiBase": "https://api.deepseek.com",
    "completionOptions": {
      "maxTokens": 4096,
      "temperature": 0,
      "topP": 1,
      "presencePenalty": 0,
      "frequencyPenalty": 0
    },
    "provider": "openai",
    "useLegacyCompletionsEndpoint": false
  }
}

此配置提示词可以进行代码补全,谢谢。期待未来的 FIM 功能

joshua-kfbb commented 2 months ago

FIM 功能未来将会直接支持,目前可以先使用如下 Continue.dev 配置:

{
  "models": [],
  "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": REDACTED,
    "contextLength": 8192,
    "apiBase": "https://api.deepseek.com",
    "completionOptions": {
      "maxTokens": 4096,
      "temperature": 0,
      "topP": 1,
      "presencePenalty": 0,
      "frequencyPenalty": 0
    },
    "provider": "openai",
    "useLegacyCompletionsEndpoint": false
  }
}

It seems that FIM is available in beta (ref: https://platform.deepseek.com/api-docs/api/create-completion/ ). Any updates on the configuration?

XieJiSS commented 2 months ago

@joshua-kfbb Yes, please refer to https://github.com/deepseek-ai/awesome-deepseek-integration/blob/main/docs/continue/README.md, we have an updated version of Continue.dev configuration there

cadl commented 2 months ago

@joshua-kfbb Yes, please refer to https://github.com/deepseek-ai/awesome-deepseek-integration/blob/main/docs/continue/README.md, we have an updated version of Continue.dev configuration there

cool