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

相关推荐
赵谨言4 小时前
基于YOLOv5的植物目标检测研究
大数据·开发语言·经验分享·python
不光头强4 小时前
IO流知识点
开发语言·python
天空属于哈夫克34 小时前
企业微信 API 发消息接口:支持私聊、群聊及多种媒体格式
数据库·微信·自动化·企业微信
高铭杰5 小时前
Postgresql源码(158)pg_filenode.map文件作用relmap和redo流程(RM_RELMAP_ID = 7)
数据库·postgresql·relmap·pg_filenode.map
老师好,我是刘同学5 小时前
Python列表用法全解析及实战示例
python
夫唯不争,故无尤也5 小时前
HTTP方法详解:GET、POST、PUT、DELETE
开发语言·windows·python
秦jh_5 小时前
【Redis】初识高并发分布式和Redis
数据库·redis·缓存
zh路西法5 小时前
【宇树机器人强化学习】(一):PPO算法的python实现与解析
python·深度学习·算法·机器学习·机器人
小钻风33665 小时前
Optional:告别NullPointerException的优雅方案
开发语言·python
远方16095 小时前
115-使用freesql体验Oracle 多版本特性
大数据·数据库·sql·ai·oracle·database