首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >PyCharm安装Continue插件对接Deepseek

PyCharm安装Continue插件对接Deepseek

作者头像
YaoQi
发布2025-07-14 19:11:33
发布2025-07-14 19:11:33
1.1K00
代码可运行
举报
运行总次数:0
代码可运行

PyCharm是一款功能强大的Python集成开发环境,支持丰富的插件扩展,能够显著提升开发效率。本文将介绍如何在PyCharm中安装和配置Continue插件,并结合Deepseek模型实现智能代码补全与增强的代码生成功能。通过这种结合,开发者可以在编写代码时获得更智能的建议和实时的辅助,提高开发效率并优化编程体验。这篇文章适合希望探索AI编程工具的开发者,让你轻松上手并充分利用PyCharm的强大功能。

(以上文字是AI代写的,感觉比我自己写的好多了)

一、安装PyCharm

略,我就是安装的最新版。

二、安装Continue插件

下载continue插件(网站才能下载最新的)

https://plugins.jetbrains.com/plugin/22707-continue/versions/eap

打开设置(Ctrl + Alt + S),选择插件Plugins

点击小齿轮配置,选择从磁盘安装:

图片
图片

弹出的窗口定位到刚下的插件压缩包,点OK。

图片
图片

三、配置DeepSeek API key

首先去注册账号(https://platform.deepseek.com/)

创建API key:

图片
图片

只能在创建时查看,复制保存好此key,后面会用到。

Continue添加chat模型

图片
图片
图片
图片

三个版本的模型,Coder是编码、Chat是V3聊天、Reasoner是R1推理。

图片
图片

配置就会出现在配置文件:

代码语言:javascript
代码运行次数:0
运行
复制
"models": [
    {
      "title": "DeepSeek Chat",
      "model": "deepseek-chat",
      "contextLength": 128000,
      "apiKey": "sk-96****************************80",
      "provider": "deepseek",
      "apiBase": "https://api.deepseek.com"
    },
    {
      "title": "DeepSeek Reasoner",
      "model": "deepseek-reasoner",
      "contextLength": 64000,
      "apiKey": "sk-96****************************80",
      "provider": "deepseek",
      "apiBase": "https://api.deepseek.com"
    },
    {
    "title": "DeepSeek Coder",
    "model": "deepseek-coder",
    "apiKey": "sk-96****************************80",
    "provider": "deepseek",
    "apiBase": "https://api.deepseek.com",
    "completionOptions": {
        "temperature": 0.0,
        "maxTokens": 1024
      }
  }
  ]

Continue配置自动完成模型

图片
图片

编辑tabAutocompleteModel,如果没有completionOptions配置可以手动添加一个:

代码语言:javascript
代码运行次数:0
运行
复制
  "tabAutocompleteModel": {
      "title": "DeepSeek Coder",
      "model": "deepseek-coder",
      "apiKey": "sk-961*****************080",
      "provider": "deepseek",
      "completionOptions": {
        "temperature": 0.0,
        "maxTokens": 1024
      }
  },
  

四、简单使用

1. 对话

Ctrl  + j 打开对话框直接对话。

选中一段代码,Ctrl + j 打开对话框,可以包含在上下文中直接提问代码功能。

图片
图片

插入、复制相关代码

图片
图片

2. 编辑代码

选中一段代码,让AI帮你编辑修改,写注释等等

图片
图片

3. 自动完成

在键入时提供内联代码建议,会在光标后显示,如果你觉得好就按Tab键输入了。

图片
图片

4. 动作

选中代码,Ctrl + J 打开对话框,输入斜线'/',选择预置动作:

图片
图片

注:预置动作在配置文件中配置"slashCommands","customCommands"

代码语言:javascript
代码运行次数:0
运行
复制
  "slashCommands": [
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ],
    "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"
    }
  ]

五、最后让deepseek帮我写个小程序

“用Python写一个加法出题机,10以内的加法,图形界面的”

参考:

https://docs.continue.dev/reference

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2025-02-11,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 漫跑的小兔 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档