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

相关推荐
代码中介商30 分钟前
Redis入门:5大数据类型全解析
数据库·redis·缓存
渣渣盟1 小时前
数据库设计范式详解(纯小白版)
数据库·oracle·软考·数据库工程师
金融大 k1 小时前
Python 全球指数监控面板:TickDB + REST + WebSocket 完整方案
python·websocket
啊哈哈121381 小时前
系统设计复盘:为什么 Agent 的 ReAct 循环必须内嵌确定性保护层——以 FitMind 健康助手的路由与步骤控制为例
人工智能·python·react
夜雪闻竹2 小时前
Cursor 对话导入:解析 SQLite 里的宝藏
数据库·sqlite·ai编程
一颗牙牙2 小时前
安装mmcv
开发语言·python·深度学习
大数据魔法师3 小时前
Streamlit(二)- Streamlit 架构与运行机制
python·web
hhb_6183 小时前
PL/SQL核心技术难点梳理与实战应用案例解析
数据库·sql
m0_470857643 小时前
PHP怎么实现工厂模式_Factory模式编写指南【指南】
jvm·数据库·python
大数据魔法师3 小时前
Streamlit(三)- Streamlit 多页面应用开发
python·web