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

相关推荐
微小冷几秒前
Optiland近轴光学
python·光学仿真·optiland·几何光学·近轴光学·高斯光学
九皇叔叔3 分钟前
RHEL 9.8 安装 Redis 8.8.1
数据库·redis·bootstrap
Python私教3 分钟前
如意 Django CRM 容器化实战:后端、前端、数据库、Redis 的协同启动逻辑
前端·数据库·django
databook6 分钟前
基于模型的重要性评分进行“特征排序”
python·机器学习·scikit-learn
码云骑士19 分钟前
94-实战Prompt优化师Agent-迭代优化-效果评分-自动生成Few-Shot
python·prompt
从零开始学习人工智能31 分钟前
PyTorch 踩坑:Input type \(Half\) and bias type \(float\) 类型不匹配终极解决方案
人工智能·pytorch·python
海盗123434 分钟前
微软技术日报——2026-08-07
python·microsoft·flask
醉城夜风~41 分钟前
querySelector()
人工智能·python·tensorflow
海兰44 分钟前
【数据库】tdsql(MySQL )的事务隔离级别
android·数据库·mysql
灵析表格1 小时前
Excel连接MySQL的函数化革命:灵析表格MySQL函数族业务应用分析
数据库·mysql·adb·excel·wps·灵析表格·excel公式盒子