pycharm + deepseek 实现curse功能

作者:G.E.N.,编辑:根根AI

DeepSeek-V3
DeepSeek-V3是一个拥有671B参数的MoE模型,吞吐量每秒达60 token,比上一代V2提升3倍;在数学代码性能上,堪比国外大模型Claude 3.5 Sonnet。
接下来,我们把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,
      "maxTokens": 256
    }
  },
  "models": [
    {
      "title": "DeepSeek",
      "model": "deepseek-chat",
      "contextLength": 128000,
      "apiKey": "REDACTED",
      "provider": "deepseek",
      "apiBase": "https://api.deepseek.com/beta"
    },
    {
      "title": "Moonshot Chat",
      "model": "moonshot-v1-8k",
      "apiKey": "sk-cz720pdHlwXjfTr8ImRSvftiAKqpSzvoLZBS2AoFH1brE4Sn",
      "provider": "moonshot"
    }
  ],
  "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。
在这里插入图片描述
在这里插入图片描述
保存文件后,即可开始使用。
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值