您现在的位置是:首页 >技术教程 >Pycharm接入DeepSeek思路分享网站首页技术教程
Pycharm接入DeepSeek思路分享
简介Pycharm接入DeepSeek思路分享
Pycharm接入DeepSeek思路分享
前言:最近DeepSeek爆火,DeepSeek-V3的发布让国产 AI 模型在国际顶尖模型中有了一席之地,今天主要分享下如何将DeepSeek接入到PyCharm中
一、创建API KEY
1.进入DeepSeek官网,点击右上角的API 开放平台。
2.点击左侧的API Keys–创建API key。
3.创建好API key后,点击复制。(tips:一定要复制下来,后面会用到)
二、下载Continue插件
1.打开PyCharm,点击设置->插件,搜索“Continue”,点击安装。
(tips:可能出现无法搜索到Continue插件的情况,可以尝试升级pycharm版本,2024.1.+以上版本应该都是支持的,不区分社区版和专业版)
2.插件安装完成后,打开配置文件config.json进行配置。
替换原始的配置文件内容,内容如下:
{
"completionOptions": {
"BaseCompletionOptions": {
"temperature": 0,
"maxTokens": 256
}
},
"models": [
{
"title": "DeepSeek",
"model": "deepseek-chat",
"contextLength": 128000,
"apiKey": "your apiKey",
"provider": "deepseek",
"apiBase": "https://api.deepseek.com/beta"
}
],
"tabAutocompleteModel": {
"title": "DeepSeek Coder",
"model": "deepseek-coder",
"apiKey": "your apiKey",
"provider": "deepseek",
"apiBase": "https://api.deepseek.com/beta"
},
"customCommands": [
{
"name": "test",
"prompt": "{{ input }}}
Write 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": "folder",
"params": {}
},
{
"name": "codebase",
"params": {}
}
],
"slashCommands": [
{
"name": "share",
"description": "Export the current chat session to markdown"
},
{
"name": "commit",
"description": "Generate a git commit message"
}
]
}
复制上面的内容,将api key 替换成自己的即可,参考下图
三、效果展示
选中需要提问的代码,对DeepSeek进行提问,能够辅助编程。
结束!!!
今天分享到这儿,存在不足的地方还请大家多多指教!!!
风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。