Skip to content

Commit

Permalink
修复DeepSeek逆向最新支持,新增r1深度思考和多轮对话
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinlic committed Nov 29, 2024
1 parent 81d2dff commit 95682d2
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 85 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![](https://img.shields.io/github/forks/llm-red-team/deepseek-free-api.svg)
![](https://img.shields.io/docker/pulls/vinlic/deepseek-free-api.svg)

支持高速流式输出、支持多轮对话,零配置部署,多路token支持。
支持高速流式输出、支持多轮对话、支持R1深度思考和静默深度思考,零配置部署,多路token支持。

与ChatGPT接口完全兼容。

Expand Down Expand Up @@ -236,31 +236,38 @@ Authorization: Bearer [userToken value]
请求数据:
```json
{
// model必须为deepseek_chat或deepseek_code
"model": "deepseek_chat",
// model名称
// 默认:deepseek
// 深度思考:deepseek-think 或 deepseek-r1
// 静默深度思考(不输出思考过程):deepseek-think-silent 或 deepseek-r1-silent
// 深度思考但思考过程使用<details>可折叠标签包裹(需要页面支持显示):deepseek-think-fold 或 deepseek-r1-fold
"model": "deepseek",
// 默认多轮对话基于消息合并实现,某些场景可能导致能力下降且受单轮最大token数限制
// 如果您想获得原生的多轮对话体验,可以传入上一轮消息获得的id,来接续上下文
// "conversation_id": "50207e56-747e-4800-9068-c6fd618374ee@2",
"messages": [
{
"role": "user",
"content": "你是谁?"
}
],
// 如果使用SSE流请设置为true,默认false
// 如果使用流式响应请设置为true,默认false
"stream": false
}
```

响应数据:
```json
{
"id": "",
"model": "deepseek_chat",
"id": "50207e56-747e-4800-9068-c6fd618374ee@2",
"model": "deepseek",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": " 我是DeepSeek Chat,一个由中国深度求索公司开发的智能助手,基于人工智能技术构建,旨在通过自然语言处理和机器学习算法来提供信息查询、对话交流和解答问题等服务。我的设计理念是遵循社会主义核心价值观,致力于为用户提供准确、安全、有益的信息和帮助"
"content": " 我是DeepSeek Chat,一个由深度求索公司开发的智能助手,旨在通过自然语言处理和机器学习技术来提供信息查询、对话交流和解答问题等服务。"
},
"finish_reason": "stop"
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deepseek-free-api",
"version": "0.0.6",
"version": "0.0.7",
"description": "DeepSeek Free API Server",
"type": "module",
"main": "dist/index.js",
Expand All @@ -13,8 +13,8 @@
"dist/"
],
"scripts": {
"dev": "tsup src/index.ts --format cjs,esm --sourcemap --dts --publicDir public --watch --onSuccess \"node dist/index.js\"",
"start": "node dist/index.js",
"dev": "tsup src/index.ts --format cjs,esm --sourcemap --dts --publicDir public --watch --onSuccess \"node --enable-source-maps --no-node-snapshot dist/index.js\"",
"start": "node --enable-source-maps --no-node-snapshot dist/index.js",
"build": "tsup src/index.ts --format cjs,esm --sourcemap --dts --clean --publicDir public"
},
"author": "Vinlic",
Expand Down
Loading

0 comments on commit 95682d2

Please sign in to comment.