vscode continue - venusir/wiki GitHub Wiki

https://blog.csdn.net/u013779722/article/details/142913645

vscode continue配置

{
  "models": [
    {
      "title": "deepseek-ai/DeepSeek-R1",
      "model": "deepseek-ai/DeepSeek-R1",
      "contextLength": 30000,
      "provider": "openai",
      "apiBase": "https://api.siliconflow.cn/v1",
      "apiKey": "sk-xxxxxxx",
      "requestOptions": {
        "extraBodyProperties": {
          "transforms": []
        }
      }
    },
    {
      "title": "deepseek-ai/DeepSeek-V3",
      "model": "deepseek-ai/DeepSeek-V3",
      "contextLength": 30000,
      "provider": "openai",
      "apiBase": "https://api.siliconflow.cn/v1",
      "apiKey": "sk-xxxxxxx",
      "requestOptions": {
        "extraBodyProperties": {
          "transforms": []
        }
      }
    },
    {
      "title": "deepseek-ai/DeepSeek-V2.5",
      "model": "deepseek-ai/DeepSeek-V2.5",
      "contextLength": 30000,
      "provider": "openai",
      "apiBase": "https://api.siliconflow.cn/v1",
      "apiKey": "sk-xxxxxxx",
      "requestOptions": {
        "extraBodyProperties": {
          "transforms": []
        }
      }
    },
    {
      "title": "Qwen/Qwen2.5-72B-Instruct-128K",
      "model": "Qwen/Qwen2.5-72B-Instruct-128K",
      "contextLength": 30000,
      "provider": "openai",
      "apiBase": "https://api.siliconflow.cn/v1",
      "apiKey": "sk-xxxxxxx",
      "requestOptions": {
        "extraBodyProperties": {
          "transforms": []
        }
      }
    }
  ],
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    },
    {
      "name": "explain",
      "prompt": "{{{ input }}}\n\n详细解释所选代码。详细说明其功能、用途和工作原理。使用示例来说明您的解释。",
      "description": "解释代码"
    },
    {
      "name": "fix",
      "prompt": "{{{ input }}}\n\n分析并修复代码中的错误。提供详细的解释和解决方案,包括但不限于语法错误、逻辑错误或性能问题。确保您的解决方案是正确的,并且能够解决所有已知的问题。",
      "description": "修复代码"
    },
    {
      "name": "check",
      "prompt": "{{{ input }}}\n\n请阅读突出显示的代码并检查是否有任何错误。您应该查找以下内容并保持高度警惕:\n- 语法错误\n- 逻辑错误\n- 安全漏洞\n- 性能问题\n- 任何其他看似错误的内容\n\n一旦您发现错误,请尽可能清楚地解释,但不要使用多余的词语。例如,不要说“我认为第 5 行有一个语法错误”,而应该说“第 5 行有语法错误”。针对发现的每个错误,给出一个要点作为答案。",
      "description": "检查代码是否存在错误"
    }
  ],
  "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",
    "maxPromptTokens": 2048,
    "prefixPercentage": 0.85,
    "maxSuffixPercentage": 0.15,
    "debounceDelay": 500,
    "multilineCompletions": "always",
    "slidingWindowPrefixPercentage": 0.75,
    "slidingWindowSize": 350,
    "maxSnippetPercentage": 0.6,
    "recentlyEditedSimilarityThreshold": 0.3,
    "useCache": true,
    "onlyMyCode": false,
    "useOtherFiles": false,
    "useRecentlyEdited": true,
    "recentLinePrefixMatchMinLength": 7
  },
  "tabAutocompleteModel": [
    {
    "title": "deepseek-ai/DeepSeek-V3",
    "provider": "openai",
    "model": "deepseek-ai/DeepSeek-V3",
    "contextLength": 30000,
    "apiBase": "https://api.siliconflow.cn/v1",
    "apiKey": "sk-xxxxxxx",
    "useLegacyCompletionsEndpoint": false
  },
  {
    "title": "deepseek-ai/DeepSeek-V2.5",
    "provider": "openai",
    "model": "deepseek-ai/DeepSeek-V2.5",
    "contextLength": 30000,
    "apiBase": "https://api.siliconflow.cn/v1",
    "apiKey": "sk-xxxxxxx",
    "useLegacyCompletionsEndpoint": false
  }
],
  "contextProviders": [
    {
      "name": "code",
      "params": {
        "nRetrieve": 25,
        "nFinal": 5,
        "useReranking": true
      },
      "useLegacyCompletionsEndpoint": false
    },
    {
      "name": "docs",
      "params": {}
    },
    {
      "name": "diff",
      "params": {
        "nRetrieve": 25,
        "nFinal": 5,
        "useReranking": true
      },
      "useLegacyCompletionsEndpoint": false
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "problems",
      "params": {}
    },
    {
      "name": "folder",
      "params": {}
    },
    {
      "name": "codebase",
      "params": {
        "nRetrieve": 25,
        "nFinal": 5,
        "useReranking": true
      },
      "useLegacyCompletionsEndpoint": false
    }
  ],
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit selected code"
    },
    {
      "name": "comment",
      "description": "Write comments for the selected code"
    },
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ],
  "allowAnonymousTelemetry": false,
  "embeddingsProvider": {
    "provider": "openai",
    "model": "BAAI/bge-m3",
    "apiBase": "https://api.siliconflow.cn/v1",
    "apiKey": "sk-xxxxxxx"
  },
  "rerank": {
    "title": "BAAI/bge-reranker-v2-m3",
    "model": "BAAI/bge-reranker-v2-m3",
    "provider": "openai",
    "apiBase": "https://api.siliconflow.cn/v1",
    "apiKey": "sk-xxxxxxx"
  }
}

apiKey可以在平台,通过 个人页面-》账号管理-》API密钥 界面进行创建,可以只创建一个,创建完之后将API密钥复制出来,然后将上面的sk-xxxxxxxx替换为您的API密钥即可.

在上面的配置中,我选用:

  • deepseek-ai/DeepSeek-V2.5 模型作为聊天模型,如果大家有需要,也可以到平台上查看,添加自己喜欢的聊天模型即可.目前我就添加了两个
  • deepseek-ai/DeepSeek-Coder-V2-Instruct 模型作为代码补全模型,这个模型的选取大家需要注意,需要选择那些支持FIM的模型.在硅基流动平台上,可以在这个链接进行查看:https://cloud.siliconflow.cn/models?tags=FIM, 目前就三个,我添加了其中两个,大家有需要也可以将qwen-coder自行加进来
  • BAAI/bge-m3 模型作为embedding模型,有了embedding模型,就可以想cursor那样,让代码模型检索我们项目中的代码,并给出意见.
⚠️ **GitHub.com Fallback** ⚠️