Skip to content

Commit efb0364

Browse files
committed
Merge branch 'feat/deepseek-search-api'
2 parents c033a7d + 3c3639f commit efb0364

16 files changed

Lines changed: 512 additions & 3 deletions

File tree

‎docs/configuration.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Deep Code 使用 `settings.json` 设置文件进行持久化配置,支持两
4545
| `telemetryEnabled` | boolean | 是否启用匿名使用数据上报(默认 `true`) |
4646
| `notify` | string | 任务完成通知脚本的完整路径(如 Slack 通知脚本) |
4747
| `webSearchTool` | string | 自定义联网搜索脚本的完整路径 |
48+
| `deepseekSearchApiEnabled` | boolean | 是否使用 DeepSeek 官方网页搜索(默认 `false`) |
4849
| `mcpServers` | object | MCP 服务器配置(键为服务名,值为 McpServerConfig 对象) |
4950
| `temperature` | number | 模型采样温度,范围 `0` 到 `2` |
5051
| `permissions` | object | 权限策略及 `addWorkingDirs` 额外工作目录配置(参见 [permission.md](./permission.md)) |
@@ -177,6 +178,12 @@ Deep Code 内置免费可用的 Web Search 工具。如果需要自定义搜索
177178

178179
脚本接收一个搜索查询参数,输出 JSON 格式的结果供 AI 使用。
179180

181+
#### `deepseekSearchApiEnabled` — 启用 DeepSeek 网页搜索 API
182+
183+
Deep Code 支持最新的[DeepSeek官方网页搜索API](https://api-docs.deepseek.com/zh-cn/guides/search)。设置 `deepseekSearchApiEnabled: true`,且当前连接的 `BASE_URL` 为 `https://api.deepseek.com` 时启用。按照官方文档介绍(截止2026-10-30),网页搜索按请求次数计费,不按 token 或返回结果条数计费,网页搜索每 1,000 次成功请求 5元。
184+
185+
`deepseekSearchApiEnabled` 默认值为 `false`。关闭开关或使用其他 API 地址时,保持原有搜索行为。
186+
180187
#### `enabledSkills` — Skill 启用配置
181188

182189
控制 skill 扫描时是否包含指定 skill。键是解析后的 skill 名称,值必须是布尔值:

‎docs/configuration_en.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ The following are all the top-level fields supported in `settings.json`, along w
4545
| `telemetryEnabled` | boolean | Enable anonymous usage reporting (default `true`) |
4646
| `notify` | string | Full path to a task-completion notification script (e.g., Slack notification script) |
4747
| `webSearchTool` | string | Full path to a custom web search script |
48+
| `deepseekSearchApiEnabled` | boolean | Use DeepSeek official web search (default `false`) |
4849
| `mcpServers` | object | MCP server configurations (keys are service names, values are McpServerConfig objects) |
4950
| `temperature` | number | Sampling temperature for LLM, from `0` to `2` |
5051
| `permissions` | object | Permission policy and additional `addWorkingDirs` workspace roots (see [permission_en.md](./permission_en.md)) |
@@ -177,6 +178,12 @@ Deep Code has a built-in, free-to-use Web Search tool. If you need custom search
177178

178179
The script receives a search query as an argument and outputs results in JSON format for the AI.
179180

181+
#### `deepseekSearchApiEnabled` — Enable the DeepSeek Web Search API
182+
183+
Deep Code supports the latest [DeepSeek official web search API](https://api-docs.deepseek.com/guides/search). Set `deepseekSearchApiEnabled: true` to enable it when the `BASE_URL` is `https://api.deepseek.com`. According to the official documentation as of October 30, 2026, web search is billed per request, rather than by tokens or the number of results returned, at $0.75 per 1,000 successful requests.
184+
185+
`deepseekSearchApiEnabled` defaults to `false`. When disabled or using another API address, the existing search behavior applies.
186+
180187
#### `enabledSkills` — Skill Enablement
181188

182189
Controls whether skills are included during skill scanning. Keys are resolved skill names, and values must be booleans:

‎packages/cli/src/tests/exec-runner.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function createSettings(
3434
reasoningEffort: "high",
3535
debugLogEnabled: false,
3636
telemetryEnabled: false,
37+
deepseekSearchApiEnabled: false,
3738
multimodal: "default",
3839
filesApiEnabled: false,
3940
filesApiTimeoutMs: 60_000,

‎packages/core/src/common/openai-client.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export function createOpenAIClient(
5353
telemetryEnabled: boolean;
5454
notify?: string;
5555
webSearchTool?: string;
56+
deepseekSearchApiEnabled?: boolean;
5657
env: Record<string, string>;
5758
machineId?: string;
5859
plusApiKey?: string;
@@ -77,6 +78,7 @@ export function createOpenAIClient(
7778
telemetryEnabled: settings.telemetryEnabled,
7879
notify: settings.notify,
7980
webSearchTool: settings.webSearchTool,
81+
deepseekSearchApiEnabled: settings.deepseekSearchApiEnabled,
8082
env: settings.env,
8183
machineId: getMachineId(),
8284
plusApiKey,
@@ -99,6 +101,7 @@ export function createOpenAIClient(
99101
telemetryEnabled: settings.telemetryEnabled,
100102
notify: settings.notify,
101103
webSearchTool: settings.webSearchTool,
104+
deepseekSearchApiEnabled: settings.deepseekSearchApiEnabled,
102105
env: settings.env,
103106
machineId: getMachineId(),
104107
plusApiKey,
@@ -140,6 +143,7 @@ export function createOpenAIClient(
140143
telemetryEnabled: settings.telemetryEnabled,
141144
notify: settings.notify,
142145
webSearchTool: settings.webSearchTool,
146+
deepseekSearchApiEnabled: settings.deepseekSearchApiEnabled,
143147
env: settings.env,
144148
machineId: getMachineId(),
145149
plusApiKey,

‎packages/core/src/common/tool-types.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export type OpenAIClientResult = {
1919
telemetryEnabled?: boolean;
2020
notify?: string;
2121
webSearchTool?: string;
22+
deepseekSearchApiEnabled?: boolean;
2223
env?: Record<string, string>;
2324
machineId?: string;
2425
plusApiKey?: string;

‎packages/core/src/settings-diagnostics.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ export function inspectSettings(options: {
164164
"telemetryEnabled",
165165
"notify",
166166
"webSearchTool",
167+
"deepseekSearchApiEnabled",
167168
"multimodal",
168169
"filesApiEnabled",
169170
"filesApiTimeoutMs",

‎packages/core/src/settings.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export type DeepcodingSettings = {
103103
telemetryEnabled?: boolean;
104104
notify?: string;
105105
webSearchTool?: string;
106+
deepseekSearchApiEnabled?: boolean;
106107
multimodal?: MultimodalMode;
107108
filesApiEnabled?: boolean;
108109
filesApiTimeoutMs?: number;
@@ -133,6 +134,7 @@ export type ResolvedDeepcodingSettings = {
133134
telemetryEnabled: boolean;
134135
notify?: string;
135136
webSearchTool?: string;
137+
deepseekSearchApiEnabled: boolean;
136138
multimodal: MultimodalMode;
137139
filesApiEnabled: boolean;
138140
filesApiTimeoutMs: number;
@@ -862,6 +864,15 @@ export function resolveSettingsSources(
862864
""
863865
);
864866

867+
const deepseekSearchApiEnabled = choose(
868+
"deepseekSearchApiEnabled",
869+
[
870+
["project.deepseekSearchApiEnabled", parseBoolean(projectSettings?.deepseekSearchApiEnabled)],
871+
["user.deepseekSearchApiEnabled", parseBoolean(userSettings?.deepseekSearchApiEnabled)],
872+
],
873+
false
874+
);
875+
865876
const multimodal = choose(
866877
"multimodal",
867878
[
@@ -995,6 +1006,7 @@ export function resolveSettingsSources(
9951006
telemetryEnabled,
9961007
notify: notify || undefined,
9971008
webSearchTool: webSearchTool || undefined,
1009+
deepseekSearchApiEnabled,
9981010
multimodal,
9991011
filesApiEnabled,
10001012
filesApiTimeoutMs,

0 commit comments

Comments
 (0)