欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 时评 > Python PyCharm DeepSeek接入

Python PyCharm DeepSeek接入

2025/2/22 23:08:36 来源:https://blog.csdn.net/qq_31939617/article/details/145627282  浏览:    关键词:Python PyCharm DeepSeek接入

Python PyCharm DeepSeek接入

创建API key

首先进入DeepSeek官网,https://www.deepseek.com/

在这里插入图片描述点击左侧“API Keys”,创建API key,输出名称为“AI”
在这里插入图片描述点击“创建",将API key保存,复制在其它地方。

在PyCharm中下载Continue插件在这里插入图片描述

在这里插入图片描述
安装
在这里插入图片描述下载中
在这里插入图片描述下载完成后,点击OK

配置Continue

在这里插入图片描述
在这里插入图片描述
安装完成后,在右侧的标签栏中,会显示一个Continue的标签,点击进入
在这里插入图片描述在这里插入图片描述

填写申请的key

在这里插入图片描述

弹出配置文件
在这里插入图片描述

我们替换

{"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"},{"model": "gpt-4o","title": "GPT-4o","systemMessage": "You are an expert software developer. You give helpful and concise responses.","apiKey": "your apiKey","provider": "openai"}],"tabAutocompleteModel": {"title": "DeepSeek Coder","model": "deepseek-coder","apiKey": "your apiKey","provider": "deepseek","apiBase": "https://api.deepseek.com/beta"},"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": "folder","params": {}},{"name": "codebase","params": {}}],"slashCommands": [{"name": "share","description": "Export the current chat session to markdown"},{"name": "commit","description": "Generate a git commit message"}]
}

这三处换成你的key

在这里插入图片描述

在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词