专栏名称: 天池大数据科研平台
天池,基于阿里云的开放数据处理服务ODPS,面向学术界开放海量数据和分布式计算资源,旨在打造“数据众智、众创”第一平台。在这里,人人都可以玩转大数据,共同探索数据众创新模式。
目录
相关文章推荐
51好读  ›  专栏  ›  天池大数据科研平台

干货教程|PyCharm如何接入DeepSeek实现AI编程

天池大数据科研平台  · 公众号  · 大数据  · 2025-02-14 11:30

正文

请到「今天看啥」查看全文


以下文章来源于根根AI ,作者G.E.N

DeepSeek-V3

DeepSeek-V3 是 DeepSeek 公司推出的最新一代 AI 模型。其前身是 DeepSeek-V2.5,经过持续的优化和升级,V3 版本在性能、速度和成本方面都取得了显著提升。

接下来,我们把DeepSeek接入到PyCharm中,并利用其能力辅助我们进行代码开发。

效果演示

首先来看一下效果。
我们可以直接选中代码,并对代码段进行解释。
我们也可以通过选中代码,对代码进行修改。

创建API Key

首先进入DeepSeek官网,官网链接如下

https://www.deepseek.com/

点击API开放平台:
点击左侧“API Keys”,点击创建 API key,输出名称为“AI 代码提示”,也可以使用其它自定义的名称。
点击“创建",一定要记录此处的 API key,可以先将 API key 复制在其它地方。


在PyCharm中下载Continue插件

打开PyCharm,打开文件->设置->插件,搜索“Continue”,点击安装。
等待插件安装完毕后,点击“应用”,插件安装成功。

配置Continue

插件安装成功后,在右侧的标签栏中,会显示一个Continue的标签,我们点击即可进入,随后点击设置按键,如下图。


点击后,文本编辑区将会弹出配置文件。
我们对配置文件进行修改,将内容替换为下面的内容:
{  "completionOptions": {    "BaseCompletionOptions": {        "temperature"0.0,        "maxTokens"256    }  },  "models": [    {      "title""DeepSeek",      "model""deepseek-chat",      "contextLength"128000,      "apiKey""REDACTED",      "provider""deepseek",      "apiBase""https://api.deepseek.com/beta"    }  ],  "tabAutocompleteModel": {    "title""DeepSeek Coder",    "model""deepseek-coder",    "apiKey""REDACTED",    "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"    }  ]}

修改时将会弹出提示,点击确定。

随后,我们将两处apiKey替换为先前保存的API key。
保存文件后,即可开始使用。







请到「今天看啥」查看全文