第一步:
在deepseek 官网上注册账号,得到APIKeys(deepseek官网地址)
创建属于自己的APIKey,然后复制这个key,(注意保存自己的key)!
第二步:
打开vscode,在插件市场安装Continue插件,
点击设置,添加deepseek模型,默认的模型用不了。
通过这个方法添加deepseek模型后,如果不起作用,建议通过config.json文件添加
文件内容:
{
"completionOptions": {
"BaseCompletionOptions": {
"temperature": 0,
"maxTokens": 256
}
},
"models": [
{
"title": "DeepSeek",
"model": "deepseek-chat",
"contextLength": 128000,
"apiKey": "你的ak",
"provider": "openai",
"apiBase": "https://api.deepseek.com/beta"
},
{
"title": "DeepSeek Coder",
"model": "deepseek-coder",
"contextLength": 128000,
"provider": "deepseek",
"apiKey": "你的ak"
}
],
"tabAutocompleteModel": {
"title": "DeepSeek",
"model": "deepseek-chat",
"apiKey": "你的ak",
"provider": "openai",
"apiBase": "https://api.deepseek.com/beta"
},
"slashCommands": [
{
"name": "edit",
"description": "Edit highlighted code"
},
{
"name": "comment",
"description": "Write comments for the highlighted code"
},
{
"name": "share",
"description": "Export the current chat session to markdown"
},
{
"name": "cmd",
"description": "Generate a shell command"
}
],
"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"
}
],
"contextProviders": [
{
"name": "diff",
"params": {}
},
{
"name": "open",
"params": {}
},
{
"name": "terminal",
"params": {}
}
]
}
添加完成后,出现如图的模型选择,就可以正常使用了。没有生效的话,可以重新打开vscode。