deepseek-ai / awesome-deepseek-integration

Creative Commons Zero v1.0 Universal
535 stars 50 forks source link

VS code Continue extension config issue. #11

Closed step-chen closed 2 months ago

step-chen commented 4 months ago

I‘m using Ubuntu 24.04 with vs code 1.89.0 and Continue 0.8.27, it will always get error with 404 error. The issue is caused by DeepSeek API only compact old openai API, so we need to add

"useLegacyCompletionsEndpoint": false

to Continue config.json. The issue is below: 微信图片_20240509091800

DillionApple commented 4 months ago

Thanks for the feedback. Currently, we do not supply the /v1/completions API.

tkizm1 commented 4 months ago
"tabAutocompleteModel": {
    "title": "deepseek api",
    "provider": "openai",
    "model": "deepseek-coder",
    "apiBase": "https://api.deepseek.com/v1",
    "apiType": "openai",
    "apiKey": "sk-xxx",
    "useLegacyCompletionsEndpoint": false,
    "useCache": true
  },

出现错误 Error: HTTP 400 Bad Request from https://api.deepseek.com/v1/chat/completions {"detail":"Stop string array too long"}

LIPUU commented 3 months ago
"tabAutocompleteModel": {
    "title": "deepseek api",
    "provider": "openai",
    "model": "deepseek-coder",
    "apiBase": "https://api.deepseek.com/v1",
    "apiType": "openai",
    "apiKey": "sk-xxx",
    "useLegacyCompletionsEndpoint": false,
    "useCache": true
  },

出现错误 Error: HTTP 400 Bad Request from https://api.deepseek.com/v1/chat/completions {"detail":"Stop string array too long"}出现错误 错误:来自 https://api.deepseek.com/v1/chat/completions 的 HTTP 400 错误请求 {“detail”:“停止字符串数组太长”}

yes i got the same error

ShawnXiha commented 3 months ago

any body know how to fix it?

tkizm1 commented 3 months ago

😅,how about use codestral instead

XieJiSS commented 3 months ago

可以使用如下 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
  }
}
ShawnXiha commented 3 months ago

可以使用如下 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
  }
}

貌似可以了,谢谢大佬

andychen2016 commented 3 months ago

感谢,可以用了。

在 2024-06-25 17:13:27,"夏强(Xia Qiang)" @.***> 写道:

可以使用如下 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}}}{{{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 } }

貌似可以了,谢谢大佬

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Atomadeus commented 2 months ago

可以使用如下 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
  }
}

其实关键就在于那句 "useLegacyCompletionsEndpoint": false,我在models里面配置也搞定了,不过还是要感谢一下