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

相关推荐
小白爱编程HC1 分钟前
用pymysql操作数据库
数据库·python·mysql
追风赶月、13 分钟前
【Redis】Redis的主从复制
数据库·redis
冰箱上的笑话17 分钟前
MySQL 数据库故障排查指南
数据库·mysql·adb
蛔虫在他乡35 分钟前
远程服务器pycharm运行tensorboard显示训练轮次图
服务器·学习·pycharm
IvanCodes1 小时前
三、Hive DDL数据库操作
大数据·数据库·hive·hadoop
尸僵打怪兽1 小时前
软考错题集
java·python·计算机网络·操作系统·c·软考·计算机组成原理
Chasing__Dreams1 小时前
Mysql--基础知识点--91.2--processlist
数据库·mysql
香蕉可乐荷包蛋1 小时前
Python学习之路(玖)-图像识别的实现
开发语言·python·学习
伊织code1 小时前
PyTorch API 1 - 概述、数学运算、nn、实用工具、函数、张量
人工智能·pytorch·python·深度学习·ai·api
Ayanamii丶2 小时前
DAY 22 复习日kaggle泰坦里克号人员生还预测
人工智能·python·机器学习