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

相关推荐
oradh20 分钟前
Oracle数据库中的Java概述
java·数据库·oracle·sql基础·oracle数据库java概述
2301_7950997440 分钟前
如何优化SQL中大批量数据的物理删除_分批次与间隔控制
jvm·数据库·python
阿kun要赚马内43 分钟前
后端数据操作组合:Pydantic与ORM
后端·python·orm·sqlalchemy
2301_812539671 小时前
CSS如何引入CSS形状生成器_通过自定义属性实现图形化样式
jvm·数据库·python
maxmaxma1 小时前
Claude Code集成DeepSeek-V4-pro全栈开发 - MCP 连接数据库
数据库·ai
lb29171 小时前
navicat连接Oracle报错了:“身份证明检索失败”
数据库·oracle·连接oracle数据库报错
xfhuangfu1 小时前
Oracle 12.2 ORA-600 数据库发生重启案例
数据库·oracle
m0_609160491 小时前
Golang怎么实现数据库连接重试_Golang如何在启动时重试连接直到数据库就绪【技巧】
jvm·数据库·python
罗超驿1 小时前
8.数据库约束学习笔记:从非空、默认、唯一与主键约束到主键自增
数据库·mysql
花米徐2 小时前
技术洞察精选 | 2026年4月28日 — 5月4日
后端·python·flask