@qilin-agent/web-search-deepseek 3.1.4 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +15 -15
- package/README.md +9 -9
- package/README.zh.md +9 -9
- package/lib/index.js +25 -28
- package/lib/types/index.d.ts +26 -11
- package/lib/types/provider.d.ts +9 -0
- package/package.json +18 -18
package/README.i18n.yaml
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
en: aa06ab491048f724
|
|
10
10
|
zh: 255a26ae5442f646
|
|
11
11
|
/qilin-agent-web-search-deepseek/summary:
|
|
12
|
-
en:
|
|
13
|
-
zh:
|
|
12
|
+
en: b756d856ed56c0ee
|
|
13
|
+
zh: 2012556cb73fa871
|
|
14
14
|
/qilin-agent-web-search-deepseek/table-of-contents:
|
|
15
15
|
en: d152484eb41ac6b4
|
|
16
16
|
zh: 09388d293f9be9cb
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
en: 467b8238cf7e140c
|
|
31
31
|
zh: 85a519c8811557aa
|
|
32
32
|
/qilin-agent-web-search-deepseek/use-this-package/failures-and-recovery:
|
|
33
|
-
en:
|
|
34
|
-
zh:
|
|
33
|
+
en: e8b3d05fa39ccf47
|
|
34
|
+
zh: 7fd9e51f4497244a
|
|
35
35
|
/qilin-agent-web-search-deepseek/understand-the-implementation:
|
|
36
36
|
en: 9842c69ad3636bb3
|
|
37
37
|
zh: 3cdc3f816cbdd0cb
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
en: c62da1892ded8f3b
|
|
46
46
|
zh: 3b9d7f7604c286cb
|
|
47
47
|
/qilin-agent-web-search-deepseek/further-exploration:
|
|
48
|
-
en:
|
|
49
|
-
zh:
|
|
48
|
+
en: c513c5c2a7ad8c93
|
|
49
|
+
zh: 8111ac4a85fecc93
|
|
50
50
|
/qilin-agent-web-search-deepseek/model-experience:
|
|
51
51
|
en: 215e7ba838619b7b
|
|
52
52
|
zh: a311da3843709f90
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
en: 722e4bf02953e236
|
|
55
55
|
zh: b3432958beb7b60f
|
|
56
56
|
/qilin-agent-web-search-deepseek/model-experience/auxiliary-deepseek-search-request/what-the-model-sees:
|
|
57
|
-
en:
|
|
58
|
-
zh:
|
|
57
|
+
en: 6b2b2909347efee8
|
|
58
|
+
zh: 664c3e210ec75cfd
|
|
59
59
|
/qilin-agent-web-search-deepseek/model-experience/auxiliary-deepseek-search-request/token-effect:
|
|
60
|
-
en:
|
|
61
|
-
zh:
|
|
60
|
+
en: 9b079b978c305dd8
|
|
61
|
+
zh: af2c3f39976b34de
|
|
62
62
|
/qilin-agent-web-search-deepseek/model-experience/auxiliary-deepseek-search-request/kv-cache-effect:
|
|
63
63
|
en: 2bac9662f1792a79
|
|
64
64
|
zh: 556d9baabd79f9cb
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
en: f5d5f97a153f7c70
|
|
76
76
|
zh: f681f89596f500f5
|
|
77
77
|
/qilin-agent-web-search-deepseek/known-limitations-and-deferred-work:
|
|
78
|
-
en:
|
|
79
|
-
zh:
|
|
78
|
+
en: 970efa0b6540b4df
|
|
79
|
+
zh: 03584df5a7ec2a8e
|
|
80
80
|
/qilin-agent-web-search-deepseek/known-limitations-and-deferred-work/dev-note:
|
|
81
81
|
en: 7f775cc79dbce94b
|
|
82
82
|
zh: 12b8f68f9e7c48ca
|
|
83
|
-
/qilin-agent-web-search-deepseek/known-limitations-and-deferred-work/dev-note/
|
|
84
|
-
en:
|
|
85
|
-
zh:
|
|
83
|
+
/qilin-agent-web-search-deepseek/known-limitations-and-deferred-work/dev-note/dedicated-retrieval-endpoint:
|
|
84
|
+
en: e8a9d9e70da86ce5
|
|
85
|
+
zh: 33ca8102965d1d0f
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
With `qilin-web-search-deepseek`, the harness searches the web through DeepSeek's native search using an existing `DEEPSEEK_API_KEY`. Choose it when a deployment wants DeepSeek native search and accepts that one search costs a full model turn in latency and tokens
|
|
12
|
+
With `qilin-web-search-deepseek`, the harness searches the web through DeepSeek's native search using an existing `DEEPSEEK_API_KEY`. Choose it when a deployment wants DeepSeek native search and accepts that one search costs a full model turn in latency and tokens; the DeepSeek Search and Fetch APIs in [qilin-web-deepseek-api](../web-deepseek-api/README.md) retrieve without one. Results come from the structured search blocks DeepSeek returns, never from scraping text out of a reply. A missing credential fails the call with a structured error; a response without a search-result block fails loudly rather than degrading. The model-facing `web_search` tool lives in `qilin-tool-web`.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -65,7 +65,7 @@ A search running under an initiating agent appends the log-only `web/deepseek-se
|
|
|
65
65
|
|
|
66
66
|
### Failures and recovery
|
|
67
67
|
|
|
68
|
-
Failures throw `WebError` with a machine-routable code: a missing credential is `WEB_PROVIDER_CREDENTIAL_MISSING`, caller cancellation is `WEB_ABORTED`, and provider or transport failures — including a response with no `web_search_tool_result` block — are `WEB_PROVIDER_ERROR`. HTTP redirects are rejected before the `Location` target is contacted. Every failure after dispatch names the resolved search endpoint and explains that search endpoint configuration is separate from chat. If the endpoint is unintended, the message tells the conversation model to guide the user to the
|
|
68
|
+
Failures throw `WebError` with a machine-routable code: a missing credential is `WEB_PROVIDER_CREDENTIAL_MISSING`, caller cancellation is `WEB_ABORTED`, and provider or transport failures — including a response with no `web_search_tool_result` block — are `WEB_PROVIDER_ERROR`. HTTP redirects are rejected before the `Location` target is contacted. Every failure after dispatch names the resolved search endpoint and explains that search endpoint configuration is separate from chat. If the endpoint is unintended, the message tells the conversation model to guide the user to the Messages API base URL field under Plugins > Built-in plugin settings > Web search and save the change. When that page is unavailable, it names `web-search-deepseek.baseURL` as the deployment configuration alternative. The model must not choose or change the endpoint. The model-facing `web_search` tool surfaces this text under its own error wrapper.
|
|
69
69
|
|
|
70
70
|
-----
|
|
71
71
|
|
|
@@ -106,7 +106,7 @@ Each search projects the current Settings section into provider options — endp
|
|
|
106
106
|
Read these pages when the package-level contract is not enough. They move from the shared vocabulary to the service, the model-facing tools, and the design rationale.
|
|
107
107
|
|
|
108
108
|
- [Web subsystem](../../../docs/subsystems/web.md) — the exhaustive search request/result vocabulary and error codes.
|
|
109
|
-
- [Web package map](../README.md) — the
|
|
109
|
+
- [Web package map](../README.md) — the seven-package family and each role.
|
|
110
110
|
- [qilin-web](../web/README.md) — the web service this provider registers into.
|
|
111
111
|
- [qilin-tool-web](../tool-web/README.md) — the model-facing `web_search` tool that renders this provider's sources.
|
|
112
112
|
- [Generated configuration catalog](../../../docs/config-catalog.md#qilin-agentweb-search-deepseek) — every accepted config field and its source declaration.
|
|
@@ -121,11 +121,11 @@ Read these pages when the package-level contract is not enough. They move from t
|
|
|
121
121
|
|
|
122
122
|
#### What the model sees
|
|
123
123
|
|
|
124
|
-
A separate DeepSeek model receives exactly `Perform a web search for the query: <query>` as its user text and one native `web_search` server-tool definition. This request is not part of the conversation model's context.
|
|
124
|
+
A separate DeepSeek model receives exactly `Perform a web search for the query: <query>` as its user text and one native `web_search` server-tool definition, with thinking disabled. This request is not part of the conversation model's context.
|
|
125
125
|
|
|
126
126
|
#### Token effect
|
|
127
127
|
|
|
128
|
-
Separate provider input and output tokens are incurred for each search; `maxTokens` caps generated output and `maxUses` caps native search uses.
|
|
128
|
+
Separate provider input and output tokens are incurred for each search; disabled thinking adds no reasoning tokens, `maxTokens` caps generated output, and `maxUses` caps native search uses.
|
|
129
129
|
|
|
130
130
|
#### KV Cache effect
|
|
131
131
|
|
|
@@ -152,10 +152,10 @@ Append-only; newly visible content follows the reusable request prefix and does
|
|
|
152
152
|
|
|
153
153
|
These limits define when the provider is expensive or incomplete. They are current package constraints.
|
|
154
154
|
|
|
155
|
-
- **One search costs a full Messages model turn** — latency plus generated tokens, with up to `maxUses` server-side searches;
|
|
155
|
+
- **One search costs a full Messages model turn** — latency plus generated tokens, with up to `maxUses` server-side searches; [qilin-web-deepseek-api](../web-deepseek-api/README.md) uses the dedicated Search API instead.
|
|
156
156
|
- **Dynamic credential availability resolves inside the operation** — the synchronous availability check can establish that a resolver exists but cannot query an asynchronous credential store, so a selected keyless provider fails the search with `WEB_PROVIDER_CREDENTIAL_MISSING`; the stable `web_search` schema stays registered.
|
|
157
157
|
- **Over-returned sources still cost tokens** — with no result-count knob on the wire, `maxResults` is enforced only post-hoc by service truncation.
|
|
158
|
-
- **
|
|
158
|
+
- **Sources usually carry no `snippet`** — a source gains one only when a text-block citation (`cited_text`) matches its URL, and DeepSeek's Anthropic-compatible endpoint returns text blocks without `citations`.
|
|
159
159
|
|
|
160
160
|
<a id="dev-note"></a>
|
|
161
161
|
### Dev Note
|
|
@@ -165,8 +165,8 @@ These limits define when the provider is expensive or incomplete. They are curre
|
|
|
165
165
|
|
|
166
166
|
This Dev Note is working context for maintainers: open questions and undecided directions. It is explicitly non-authoritative — shipped behavior, limits, and rationale live in the sections above and the linked Agent Notes.
|
|
167
167
|
|
|
168
|
-
####
|
|
168
|
+
#### Dedicated retrieval endpoint
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
DeepSeek's Search and Fetch APIs, which avoid the full model turn, live in [qilin-web-deepseek-api](../web-deepseek-api/README.md) and are selected by the Web search settings switch; this provider stays the default until the Search API launch is announced.
|
|
171
171
|
|
|
172
172
|
</details>
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
有了 `qilin-web-search-deepseek`,harness 可以通过 DeepSeek 原生搜索检索 web,使用部署已有的 `DEEPSEEK_API_KEY`。当部署希望使用 DeepSeek 原生搜索、并接受一次搜索在延迟与 token
|
|
12
|
+
有了 `qilin-web-search-deepseek`,harness 可以通过 DeepSeek 原生搜索检索 web,使用部署已有的 `DEEPSEEK_API_KEY`。当部署希望使用 DeepSeek 原生搜索、并接受一次搜索在延迟与 token 上消耗一个完整模型轮次时选择它;[qilin-web-deepseek-api](../web-deepseek-api/README.zh.md) 中的 DeepSeek Search 与 Fetch API 无需模型轮次即可检索。结果来自 DeepSeek 返回的结构化搜索块,绝不会从回复文本中抓取。凭据缺失时调用以结构化错误失败;响应缺少搜索结果块时会明确报错,而非降级。面向模型的 `web_search` 工具位于 `qilin-tool-web`。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -65,7 +65,7 @@ kind: "package-reference"
|
|
|
65
65
|
|
|
66
66
|
### 失败与恢复
|
|
67
67
|
|
|
68
|
-
失败抛出携带可按机器路由 code 的 `WebError`:凭据缺失为 `WEB_PROVIDER_CREDENTIAL_MISSING`,调用方取消为 `WEB_ABORTED`,提供方或传输失败,包括响应中没有 `web_search_tool_result` 块,为 `WEB_PROVIDER_ERROR`。HTTP 重定向会在接触 `Location` 指向的目标之前被拒绝。请求发出后的每项失败都会指出已解析的搜索端点,并说明搜索端点配置独立于聊天端点。如果该端点不符合用户预期,错误消息会要求会话模型指导用户进入
|
|
68
|
+
失败抛出携带可按机器路由 code 的 `WebError`:凭据缺失为 `WEB_PROVIDER_CREDENTIAL_MISSING`,调用方取消为 `WEB_ABORTED`,提供方或传输失败,包括响应中没有 `web_search_tool_result` 块,为 `WEB_PROVIDER_ERROR`。HTTP 重定向会在接触 `Location` 指向的目标之前被拒绝。请求发出后的每项失败都会指出已解析的搜索端点,并说明搜索端点配置独立于聊天端点。如果该端点不符合用户预期,错误消息会要求会话模型指导用户进入 Plugins > Built-in plugin settings > Web search,修改 Messages API 基础地址字段并保存。该页面不可用时,消息会把 `web-search-deepseek.baseURL` 作为部署配置方式。模型不得替用户选择或修改端点。面向模型的 `web_search` 工具会在自己的错误包装层内呈现这段文本。
|
|
69
69
|
|
|
70
70
|
-----
|
|
71
71
|
|
|
@@ -106,7 +106,7 @@ kind: "package-reference"
|
|
|
106
106
|
当包级约定不够用时阅读以下页面。它们从共享词汇逐步进入服务、面向模型的工具与设计依据。
|
|
107
107
|
|
|
108
108
|
- [web 子系统](../../../docs/subsystems/web.zh.md)——穷尽式的搜索请求/结果词汇与错误码。
|
|
109
|
-
- [web 包映射](../README.zh.md)
|
|
109
|
+
- [web 包映射](../README.zh.md)——七包家族与各角色。
|
|
110
110
|
- [qilin-web](../web/README.zh.md)——本提供方注册进入的 web 服务。
|
|
111
111
|
- [qilin-tool-web](../tool-web/README.zh.md)——渲染本提供方来源的面向模型 `web_search` 工具。
|
|
112
112
|
- [生成配置目录](../../../docs/config-catalog.zh.md#qilin-agentweb-search-deepseek)——每个受支持配置字段及其源声明。
|
|
@@ -121,11 +121,11 @@ kind: "package-reference"
|
|
|
121
121
|
|
|
122
122
|
#### 模型看到的内容
|
|
123
123
|
|
|
124
|
-
独立的 DeepSeek 模型会原样接收 `Perform a web search for the query: <query>` 作为用户文本,并收到一个原生 `web_search`
|
|
124
|
+
独立的 DeepSeek 模型会原样接收 `Perform a web search for the query: <query>` 作为用户文本,并收到一个原生 `web_search` 服务器工具定义,思考模式关闭。该请求不属于会话模型上下文。
|
|
125
125
|
|
|
126
126
|
#### Token 影响
|
|
127
127
|
|
|
128
|
-
每次搜索都会产生独立的提供方输入与输出 token
|
|
128
|
+
每次搜索都会产生独立的提供方输入与输出 token;关闭思考模式不产生推理 token,`maxTokens` 限制生成输出,`maxUses` 限制原生搜索次数。
|
|
129
129
|
|
|
130
130
|
#### KV Cache 影响
|
|
131
131
|
|
|
@@ -152,10 +152,10 @@ kind: "package-reference"
|
|
|
152
152
|
|
|
153
153
|
这些限制说明提供方在哪些情况下昂贵或不完整。它们是当前包约束。
|
|
154
154
|
|
|
155
|
-
- **一次搜索消耗一个完整的 Messages 模型轮次**——产生延迟与生成 token,最多执行 `maxUses` 次服务端搜索;
|
|
155
|
+
- **一次搜索消耗一个完整的 Messages 模型轮次**——产生延迟与生成 token,最多执行 `maxUses` 次服务端搜索;[qilin-web-deepseek-api](../web-deepseek-api/README.zh.md) 改用专用的 Search API。
|
|
156
156
|
- **动态凭据的可用性在操作内部解析**——同步可用性检查可以确认解析器存在,但无法查询异步凭据存储,因此选中的无密钥提供方会使搜索以 `WEB_PROVIDER_CREDENTIAL_MISSING` 失败;稳定的 `web_search` schema 仍保持注册。
|
|
157
157
|
- **超量返回的来源仍消耗 token**——协议没有结果数量旋钮,`maxResults` 只能由服务在事后截断。
|
|
158
|
-
-
|
|
158
|
+
- **来源通常没有 `snippet`**——只有当文本块引用(`cited_text`)匹配其 URL 时,来源才会获得 snippet,而 DeepSeek 的 Anthropic 兼容端点返回的文本块不带 `citations`。
|
|
159
159
|
|
|
160
160
|
<a id="dev-note"></a>
|
|
161
161
|
### 开发备注
|
|
@@ -165,8 +165,8 @@ kind: "package-reference"
|
|
|
165
165
|
|
|
166
166
|
本开发备注是维护者的工作上下文:开放问题与尚未决定的探索方向。它明确不具权威性——已交付的行为、限制与既定理由以上文和相关 Agent Note 为准。
|
|
167
167
|
|
|
168
|
-
####
|
|
168
|
+
#### 专用检索端点
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
无需完整模型轮次的 DeepSeek Search 与 Fetch API 位于 [qilin-web-deepseek-api](../web-deepseek-api/README.zh.md),由网页搜索设置页的开关选择;在 Search API 正式发布公告之前,本提供方仍是默认值。
|
|
171
171
|
|
|
172
172
|
</details>
|
package/lib/index.js
CHANGED
|
@@ -119,7 +119,8 @@ var DeepSeekSearchProvider = class {
|
|
|
119
119
|
type: "web_search_20250305",
|
|
120
120
|
name: "web_search",
|
|
121
121
|
max_uses: options.maxUses
|
|
122
|
-
}]
|
|
122
|
+
}],
|
|
123
|
+
thinking: { type: "disabled" }
|
|
123
124
|
};
|
|
124
125
|
options.recordRequest?.({
|
|
125
126
|
endpoint,
|
|
@@ -187,7 +188,7 @@ var DeepSeekSearchProvider = class {
|
|
|
187
188
|
};
|
|
188
189
|
/** Add endpoint recovery instructions to failures that occur after request dispatch begins. */
|
|
189
190
|
function searchEndpointError(endpoint, message, cause) {
|
|
190
|
-
return new WebError(`${message}\n\nThe web
|
|
191
|
+
return new WebError(`${message}\n\nThe web request used endpoint ${JSON.stringify(endpoint)}. Search endpoint configuration is separate from chat. If that endpoint is not intended, guide the user to Plugins > Built-in plugin settings > Web search, where they can change and save Messages API base URL. If that settings page is unavailable, the user can set web-search-deepseek.baseURL to a trusted DeepSeek endpoint. Only the user should choose or change the endpoint.`, "WEB_PROVIDER_ERROR", cause === void 0 ? void 0 : { cause });
|
|
191
192
|
}
|
|
192
193
|
/**
|
|
193
194
|
* Race a same-process asynchronous preflight against caller cancellation. The
|
|
@@ -239,23 +240,20 @@ function isPositiveInteger(value) {
|
|
|
239
240
|
const name = "web-search-deepseek";
|
|
240
241
|
/** The web seam this provider registers into. */
|
|
241
242
|
const inject = ["web"];
|
|
242
|
-
const DEFAULT_API_KEY_ENV = "DEEPSEEK_API_KEY";
|
|
243
243
|
const Config = z.object({
|
|
244
|
-
apiKey: z.string().role("secret"),
|
|
245
|
-
apiKeyEnv: z.string().role("credential-ref").default(
|
|
246
|
-
baseURL: z.string(),
|
|
247
|
-
model: z.string().default(DEEPSEEK_DEFAULT_MODEL),
|
|
248
|
-
apiVersion: z.string().default(DEEPSEEK_DEFAULT_API_VERSION),
|
|
249
|
-
maxTokens: z.number().step(1).min(1).default(DEEPSEEK_DEFAULT_MAX_TOKENS),
|
|
250
|
-
maxUses: z.number().step(1).min(1).default(5)
|
|
244
|
+
apiKey: z.string().role("secret").volatile(),
|
|
245
|
+
apiKeyEnv: z.string().role("credential-ref").default("DEEPSEEK_API_KEY").volatile(),
|
|
246
|
+
baseURL: z.string().volatile(),
|
|
247
|
+
model: z.string().default(DEEPSEEK_DEFAULT_MODEL).volatile(),
|
|
248
|
+
apiVersion: z.string().default(DEEPSEEK_DEFAULT_API_VERSION).volatile(),
|
|
249
|
+
maxTokens: z.number().step(1).min(1).default(DEEPSEEK_DEFAULT_MAX_TOKENS).volatile(),
|
|
250
|
+
maxUses: z.number().step(1).min(1).default(5).volatile()
|
|
251
251
|
});
|
|
252
252
|
/**
|
|
253
253
|
* Auxiliary-search endpoint, independent of the conversation adapter's
|
|
254
254
|
* `$DEEPSEEK_BASE_URL` and selected protocol.
|
|
255
255
|
*/
|
|
256
256
|
const SEARCH_BASE_URL_ENV = "DEEPSEEK_SEARCH_BASE_URL";
|
|
257
|
-
/** Settings namespace carrying this provider's endpoint, model, and key reference. */
|
|
258
|
-
const WEB_SEARCH_DEEPSEEK_SETTINGS_NAMESPACE = "web-search-deepseek";
|
|
259
257
|
/**
|
|
260
258
|
* Project one resolved section into the options the provider serves its next
|
|
261
259
|
* search with. Environment fallbacks stay here rather than in the provider:
|
|
@@ -265,7 +263,7 @@ const WEB_SEARCH_DEEPSEEK_SETTINGS_NAMESPACE = "web-search-deepseek";
|
|
|
265
263
|
* @returns options for one search.
|
|
266
264
|
*/
|
|
267
265
|
function resolveOptions(ctx, config) {
|
|
268
|
-
const apiKeyEnv = credentialRef(config.apiKeyEnv
|
|
266
|
+
const apiKeyEnv = credentialRef(config.apiKeyEnv);
|
|
269
267
|
const literalApiKey = config.apiKey !== void 0 && config.apiKey.length > 0 ? config.apiKey : void 0;
|
|
270
268
|
return {
|
|
271
269
|
...literalApiKey === void 0 ? {} : { apiKey: literalApiKey },
|
|
@@ -277,10 +275,10 @@ function resolveOptions(ctx, config) {
|
|
|
277
275
|
},
|
|
278
276
|
apiKeyEnv,
|
|
279
277
|
baseURL: config.baseURL ?? launchEnvironmentOf(ctx).get(SEARCH_BASE_URL_ENV)?.value ?? "https://api.deepseek.com/anthropic/v1",
|
|
280
|
-
model: config.model
|
|
281
|
-
apiVersion: config.apiVersion
|
|
282
|
-
maxTokens: config.maxTokens
|
|
283
|
-
maxUses: config.maxUses
|
|
278
|
+
model: config.model,
|
|
279
|
+
apiVersion: config.apiVersion,
|
|
280
|
+
maxTokens: config.maxTokens,
|
|
281
|
+
maxUses: config.maxUses,
|
|
284
282
|
recordRequest: (request) => {
|
|
285
283
|
ctx.get("agents")?.currentInitiator()?.session.append("web/deepseek-search-llm-request", request);
|
|
286
284
|
}
|
|
@@ -288,16 +286,15 @@ function resolveOptions(ctx, config) {
|
|
|
288
286
|
}
|
|
289
287
|
/** Register the DeepSeek search provider with `ctx.web`. */
|
|
290
288
|
function apply(ctx, config) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
});
|
|
300
|
-
ctx.web.registerSearchProvider(new DeepSeekSearchProvider(() => resolveOptions(ctx, current())));
|
|
289
|
+
ctx.web.registerSearchProvider(new DeepSeekSearchProvider(() => resolveOptions(ctx, {
|
|
290
|
+
apiKey: config.apiKey.get(),
|
|
291
|
+
apiKeyEnv: config.apiKeyEnv.get(),
|
|
292
|
+
baseURL: config.baseURL.get(),
|
|
293
|
+
model: config.model.get(),
|
|
294
|
+
apiVersion: config.apiVersion.get(),
|
|
295
|
+
maxTokens: config.maxTokens.get(),
|
|
296
|
+
maxUses: config.maxUses.get()
|
|
297
|
+
})));
|
|
301
298
|
}
|
|
302
299
|
//#endregion
|
|
303
|
-
export { Config, DEEPSEEK_DEFAULT_API_VERSION, DEEPSEEK_DEFAULT_BASE_URL, DEEPSEEK_DEFAULT_MAX_TOKENS, DEEPSEEK_DEFAULT_MAX_USES, DEEPSEEK_DEFAULT_MODEL, DEEPSEEK_PROVIDER_ID, DeepSeekSearchProvider,
|
|
300
|
+
export { Config, DEEPSEEK_DEFAULT_API_VERSION, DEEPSEEK_DEFAULT_BASE_URL, DEEPSEEK_DEFAULT_MAX_TOKENS, DEEPSEEK_DEFAULT_MAX_USES, DEEPSEEK_DEFAULT_MODEL, DEEPSEEK_PROVIDER_ID, DeepSeekSearchProvider, apply, inject, name };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -6,32 +6,47 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Context } from '@qilin-agent/kylin';
|
|
8
8
|
import z from '@qilin-agent/schemastery';
|
|
9
|
+
import type { Volatile } from '@qilin-agent/kylin';
|
|
9
10
|
export { DeepSeekSearchProvider, DEEPSEEK_DEFAULT_API_VERSION, DEEPSEEK_DEFAULT_BASE_URL, DEEPSEEK_DEFAULT_MAX_TOKENS, DEEPSEEK_DEFAULT_MAX_USES, DEEPSEEK_DEFAULT_MODEL, DEEPSEEK_PROVIDER_ID, } from './provider.ts';
|
|
10
11
|
export type { DeepSeekSearchLlmRequest, DeepSeekSearchProviderOptions } from './provider.ts';
|
|
11
12
|
/** Cordis plugin name used by loader diagnostics. */
|
|
12
13
|
export declare const name = "web-search-deepseek";
|
|
13
14
|
/** The web seam this provider registers into. */
|
|
14
15
|
export declare const inject: string[];
|
|
15
|
-
/** Plugin config
|
|
16
|
+
/** Plugin config, live without remounting. */
|
|
16
17
|
export interface Config {
|
|
17
18
|
/** Literal DeepSeek API key; prefer {@link apiKeyEnv} so no secret enters configuration files. */
|
|
18
|
-
apiKey
|
|
19
|
+
apiKey: Volatile<string | undefined>;
|
|
19
20
|
/** Credential reference resolved for each search; defaults to `DEEPSEEK_API_KEY`. */
|
|
20
|
-
apiKeyEnv
|
|
21
|
+
apiKeyEnv: Volatile<string>;
|
|
21
22
|
/** Anthropic-compatible endpoint base; `/messages` is appended. */
|
|
22
|
-
baseURL
|
|
23
|
+
baseURL: Volatile<string | undefined>;
|
|
23
24
|
/** Anthropic-format model name. Defaults to `deepseek-v4-flash`. */
|
|
24
|
-
model
|
|
25
|
+
model: Volatile<string>;
|
|
25
26
|
/** `anthropic-version` header value. Defaults to `2023-06-01`. */
|
|
26
|
-
apiVersion
|
|
27
|
+
apiVersion: Volatile<string>;
|
|
27
28
|
/** Upper bound on generated tokens for the Messages request. Defaults to 4096. */
|
|
28
|
-
maxTokens
|
|
29
|
+
maxTokens: Volatile<number>;
|
|
29
30
|
/** Maximum `web_search` server-tool uses per request. Defaults to 5. */
|
|
30
|
-
maxUses
|
|
31
|
+
maxUses: Volatile<number>;
|
|
31
32
|
}
|
|
32
|
-
export declare const Config: z<
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
34
|
+
apiKey: z<string, string, "volatile">;
|
|
35
|
+
apiKeyEnv: z<string, string, "volatile-defined">;
|
|
36
|
+
baseURL: z<string, string, "volatile">;
|
|
37
|
+
model: z<string, string, "volatile-defined">;
|
|
38
|
+
apiVersion: z<string, string, "volatile-defined">;
|
|
39
|
+
maxTokens: z<number, number, "volatile-defined">;
|
|
40
|
+
maxUses: z<number, number, "volatile-defined">;
|
|
41
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
42
|
+
apiKey: z<string, string, "volatile">;
|
|
43
|
+
apiKeyEnv: z<string, string, "volatile-defined">;
|
|
44
|
+
baseURL: z<string, string, "volatile">;
|
|
45
|
+
model: z<string, string, "volatile-defined">;
|
|
46
|
+
apiVersion: z<string, string, "volatile-defined">;
|
|
47
|
+
maxTokens: z<number, number, "volatile-defined">;
|
|
48
|
+
maxUses: z<number, number, "volatile-defined">;
|
|
49
|
+
}>>, "plain">;
|
|
35
50
|
/** Register the DeepSeek search provider with `ctx.web`. */
|
|
36
51
|
export declare function apply(ctx: Context, config: Config): void;
|
|
37
52
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/provider.d.ts
CHANGED
|
@@ -55,6 +55,15 @@ export interface DeepSeekSearchLlmRequest {
|
|
|
55
55
|
readonly max_uses: number;
|
|
56
56
|
}
|
|
57
57
|
];
|
|
58
|
+
/**
|
|
59
|
+
* Thinking mode for the auxiliary turn. The provider always sends
|
|
60
|
+
* `disabled`: it discards the generated text, so reasoning tokens have no
|
|
61
|
+
* consumer. Absent means the request omitted the field and the provider
|
|
62
|
+
* applied its default.
|
|
63
|
+
*/
|
|
64
|
+
readonly thinking?: {
|
|
65
|
+
readonly type: 'disabled';
|
|
66
|
+
};
|
|
58
67
|
};
|
|
59
68
|
}
|
|
60
69
|
declare module '@qilin-agent/session/types' {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/web-search-deepseek",
|
|
3
3
|
"description": "DeepSeek-backed search provider (native web_search via the Anthropic-compatible API) for the QiLin web capability seam (ctx.web)",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.6",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -30,26 +30,26 @@
|
|
|
30
30
|
],
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@qilin-agent/agent": "3.1.
|
|
34
|
-
"@qilin-agent/
|
|
35
|
-
"@qilin-agent/
|
|
36
|
-
"@qilin-agent/
|
|
37
|
-
"@qilin-agent/
|
|
38
|
-
"@qilin-agent/
|
|
39
|
-
"@qilin-agent/
|
|
33
|
+
"@qilin-agent/agent": "3.1.6",
|
|
34
|
+
"@qilin-agent/launch-environment": "3.1.6",
|
|
35
|
+
"@qilin-agent/session": "3.1.6",
|
|
36
|
+
"@qilin-agent/web": "3.1.6",
|
|
37
|
+
"@qilin-agent/kylin": "~4.0.5",
|
|
38
|
+
"@qilin-agent/settings": "3.1.6",
|
|
39
|
+
"@qilin-agent/credentials": "3.1.6"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@qilin-agent/schemastery": "~3.18.
|
|
42
|
+
"@qilin-agent/schemastery": "~3.18.5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@qilin-agent/
|
|
46
|
-
"@qilin-agent/
|
|
47
|
-
"@qilin-agent/credentials-local": "3.1.
|
|
48
|
-
"@qilin-agent/
|
|
49
|
-
"@qilin-agent/session": "3.1.
|
|
50
|
-
"@qilin-agent/web": "3.1.
|
|
51
|
-
"@qilin-agent/kylin": "~4.0.
|
|
52
|
-
"@qilin-agent/settings": "3.1.
|
|
53
|
-
"@qilin-agent/http-proxy": "3.1.
|
|
45
|
+
"@qilin-agent/agent": "3.1.6",
|
|
46
|
+
"@qilin-agent/credentials": "3.1.6",
|
|
47
|
+
"@qilin-agent/credentials-local": "3.1.6",
|
|
48
|
+
"@qilin-agent/launch-environment": "3.1.6",
|
|
49
|
+
"@qilin-agent/session": "3.1.6",
|
|
50
|
+
"@qilin-agent/web": "3.1.6",
|
|
51
|
+
"@qilin-agent/kylin": "~4.0.5",
|
|
52
|
+
"@qilin-agent/settings": "3.1.6",
|
|
53
|
+
"@qilin-agent/http-proxy": "3.1.6"
|
|
54
54
|
}
|
|
55
55
|
}
|