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

相关推荐
头发够用的程序员13 分钟前
C++和Python面试经典算法汇总(一)
开发语言·c++·python·算法·容器·面试
夜猫逐梦25 分钟前
【逆向经验】一篇文章讲透为什么CE搜不到Python游戏的内存值
开发语言·python·游戏
Zik----34 分钟前
CILP模型讲解
人工智能·python·多模态
星马梦缘34 分钟前
数据库作战记录 实验7、8
数据库·sql·oracle
陈eaten40 分钟前
汇编使用AES指令集实现AES解密
汇编·python·aes解密·aes指令集
SilentSamsara1 小时前
闭包的本质:Python 如何捕获自由变量
开发语言·python·青少年编程·pycharm
安逸sgr1 小时前
Hermes Agent + Obsidian 打造第二大脑(六):分层记忆系统的设计逻辑——L0/L1/L2/L3 四层记忆详解
数据库·agent·知识库·hermes·hermesagent
段一凡-华北理工大学1 小时前
【高炉炼铁领域炉温监测、预警、调控智能体设计与应用】~系列文章10:实时预警机制:跑在问题前面!
网络·人工智能·python·知识图谱·高炉炼铁·工业智能体
小熊Coding1 小时前
童年游戏冒险岛(Python版本)
python·游戏·pygame
苍煜1 小时前
一篇讲懂分库分表:概念、spirngboot实战
数据库·oracle