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

弹出配置文件

我们替换

bash 复制代码
{
  "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

相关推荐
李妍.2 分钟前
PyTorch GPU 版安装记录(RTX 5060 + Python 3.14)
人工智能·pytorch·python
90后的晨仔5 分钟前
Python 基础语法完整汇总
python
广慈新医知7 分钟前
当健康问题越来越复杂,AI更适合先帮我们“把问题问清楚”
人工智能·python
一晌小贪欢8 分钟前
python-第27天:Python面向对象详解
开发语言·python·数据可视化·面向对象·python办公
青 春 记 忆11 分钟前
LeetCode 350. 两个数组的交集 II|Python 解法详解
python·算法·leetcode
ZGG00319 分钟前
线程池详解:从 7 大参数到生产避坑
java·数据库·后端
龙亘川22 分钟前
数智赋能退役军人服务:V1.0 系统搭建全生命周期闭环服务体系
大数据·数据库·人工智能
zhangguojia71 小时前
权限弹窗点击允许的授权流程
运维·服务器·数据库
jnrjian1 小时前
Postgres 序列(sequence)的权限
数据库·postgresql
风禾万里1 小时前
【无标题】
数据库