feat: 更新 DeepSeek 模型并支持 Responses API - #228
Open
RayySummers wants to merge 3 commits into
Open
Conversation
Reviewer's GuideUpdates DeepSeek integration to default to V4 models and to support both the official Responses API and OpenAI-compatible chat completions, with a configurable API format option in settings and corresponding docs/UI/config updates. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
useResponsesApi/URL construction, relying onendpoint.replace(/\/chat\/completions\/?...assumes a specific path shape; consider more robust handling (e.g., appending/responsesonly when needed and avoiding mismatched payload/endpoint combinations for custom proxies). deepseekResponsesMsgTemplatecurrently hardcodestemperature: 0.7and omits other configurable parameters; it would be cleaner to reuse the existing config-driven settings (e.g., temperature) so behavior stays consistent across DeepSeek API formats.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `useResponsesApi`/URL construction, relying on `endpoint.replace(/\/chat\/completions\/?...` assumes a specific path shape; consider more robust handling (e.g., appending `/responses` only when needed and avoiding mismatched payload/endpoint combinations for custom proxies).
- `deepseekResponsesMsgTemplate` currently hardcodes `temperature: 0.7` and omits other configurable parameters; it would be cleaner to reuse the existing config-driven settings (e.g., temperature) so behavior stays consistent across DeepSeek API formats.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
本 PR 更新了 DeepSeek 的模型与请求格式适配,新增可配置的 API 格式选择,以便在官方 Responses API 与 OpenAI 风格 Chat Completions 之间按模型/设置切换,提升对 DeepSeek v4 系列与第三方代理的兼容性。
Changes:
- DeepSeek 模型列表更新为
deepseek-v4-flash/deepseek-v4-pro,并在文档中推荐默认使用 v4-flash。 - 新增 DeepSeek API 格式选项(auto / Responses / Chat),并在 DeepSeek 服务请求侧实现端点与返回解析的分支逻辑。
- 抽取
getCurrentModel()用于解析当前实际模型名(去掉中文括号后缀)。
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| entrypoints/utils/template.ts | 新增当前模型解析与 DeepSeek Responses API 请求体模板;保留 chat completions 模板 |
| entrypoints/utils/option.ts | 更新 DeepSeek 模型列表;新增 deepseekApiType 下拉选项数据 |
| entrypoints/utils/model.ts | Config 增加 deepseekApiType 字段并提供默认值 auto |
| entrypoints/service/newapi.ts | 清理未使用的 deepseekMsgTemplate 引用(保持 NewAPI 使用通用模板) |
| entrypoints/service/deepseek.ts | 根据 deepseekApiType/模型选择 Responses 或 Chat;调整请求端点与响应解析 |
| docs/config/translation-engines.md | 文档推荐模型从 deepseek-chat 更新为 deepseek-v4-flash |
| components/Main.vue | DeepSeek 服务下新增“API 格式”配置项,并绑定到 config.deepseekApiType |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+24
to
+31
| const model = getCurrentModel(); | ||
| const endpoint = config.proxy[config.service] || urls[config.service]; | ||
|
|
||
| // Responses API 与 chat completions 的端点不同,把 /chat/completions 路径替换为 /responses | ||
| const isResponses = useResponsesApi(model); | ||
| const url = isResponses | ||
| ? endpoint.replace(/\/chat\/completions\/?$/, '/responses') | ||
| : endpoint; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
deepseek-chat/deepseek-reasoner(已于 2026-07-24 弃用)→deepseek-v4-flash/deepseek-v4-prodeepseek-v4-flash走官方 Responses API(/responses,instructions+input格式),deepseek-v4-pro及自定义模型走 Chat CompletionSummary by Sourcery
Update DeepSeek integration to use the new v4 models and support both Responses and chat completion APIs with configurable selection.
New Features:
Enhancements:
Documentation: