Can´t use DeepSeek API
- 主要語言
- Shell
- 星號
- 11.2k
- 分支
- 1.9k
- 平均合併
- 14 小時 16 分鐘
- 30 天內合併 PR
- 6
描述
### Describe the bug
When I run the following command:
```bash
export COPILOT_PROVIDER_BASE_URL="https://api.deepseek.com" \
export COPILOT_PROVIDER_API_KEY="...." \
export COPILOT_PROVIDER_TYPE="openai" \
export COPILOT_MODEL="deepseek-v4-pro" \
copilot
```
When I make a question to the copilot, I get this answer back:
```
● Request failed (transient_bad_request). Retrying...
● Request failed (transient_bad_request). Retrying...
✗ 400 The `reasoning_content` in the thinking mode must be passed back to the API.
```
I confirm that the DeepSeek API needs the entire reasoning_content field to be returned back to the API every time. In my own code I had the same problem and could rapidly fix the issue by sending back the the entire conversation.
### Affected version
_No response_
### Steps to reproduce the behavior
I run the following command:
```bash
export COPILOT_PROVIDER_BASE_URL="https://api.deepseek.com" \
export COPILOT_PROVIDER_API_KEY="...." \
export COPILOT_PROVIDER_TYPE="openai" \
export COPILOT_MODEL="deepseek-v4-pro" \
copilot
```
Ensure to have a valid api key for the DeepSeek endpoint
### Expected behavior
I expect the request to be fulfilled.
### Additional context
_No response_
貢獻指南
研究方向
首先,使用文件中記載的 DeepSeek 環境變數,透過 `copilot` 入口重現問題,並檢查請求對話是如何組裝的。當完整的 `reasoning_content` 傳回 DeepSeek API,且請求在沒有 400 錯誤的情況下成功時,修正就完成了。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- shell
- 領域
- api
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100