aaronlei/dsh-web-search-diy ↗★ 4
dsh-web-search-diy
提供四种可选协议的自定义网页搜索源 适合需要灵活配置第三方或自定义搜索接口以增强聊天检索的用户。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:aaronlei/dsh-web-search-diy说明文档
阅读完整 README ↗Configuration
The provider resolves options with precedence UI-managed file ($DSH_HOME/dsh-web-search-diy.json, written by the configuration page) > settings section / entry config > package defaults.
That file is bucketed by protocol mode:
{
"version": 2,
"mode": "anthropic-messages",
"modes": {
"anthropic-messages": { "baseURL": "...", "model": "deepseek-flash", "maxUses": 8 },
"zhipu-chat-search": { "apiKeyEnv": "ZAI_CODING_CN_API_KEY", "searchEngine": "search_pro" }
}
}
Every mode keeps its own endpoint, model, credential reference, output budget, and search options, so entering a mode restores that mode's settings — including after a page reload — instead of carrying the previous mode's values over or replacing them with canonical defaults. A mode with no bucket yet starts from that mode's official values. Top-level mode is the selected mode. Each bucket holds only the keys that mode actually uses: the page submits its whole form, so a field belonging to another mode is never written, and a leftover of one in an existing bucket is dropped on that mode's next save. Keys cleared in the page are deleted rather than stored blank, so the file only ever holds real choices, and an emptied bucket is dropped entirely. A file written by an earlier release (one flat object) is projected onto the mode it selected when read, and the next save rewrites it in the bucketed shape; reads never write. Keep a copy before a downgrade: an older plugin sees only the top-level mode and ignores the buckets.
| Key | Default | Meaning |
|---|---|---|
mode | responses | Protocol: responses / anthropic-messages / zhipu-web-search / zhipu-chat-search |
apiKey | — | Literal API key; overrides apiKeyEnv when set |
apiKeyEnv | per mode (see above) | Credential reference resolved per search via ctx.credentials; blank uses the mode's own chain |
baseURL | per mode (see above) | API base; /responses, /messages, /web_search, or /chat/completions is appended per mode |
model | per mode (see above) | Model served by the endpoint; zhipu-web-search has no model turn and ignores this key |
maxOutputTokens | per mode: 65536 in anthropic-messages, 4096 elsewhere | Output cap for one search turn (max_output_tokens in responses, max_tokens in anthropic-messages and zhipu-chat-search) |
apiVersion | 2023-06-01 | anthropic-version header sent with each request (anthropic-messages only) |
maxUses | 5 | Maximum web_search server-tool uses per request, sent as max_uses (anthropic-messages only) |
anthropicThinking | default | default sends no parameter; disabled sends thinking: {type: "disabled"} (anthropic-messages only) |
searchEngine | search_std | Zhipu engine: search_std / search_pro / search_pro_sogou / search_pro_quark (Zhipu modes) |
count | 10 | Zhipu result count (1-50); a request-supplied maxResults cap takes precedence (Zhipu modes) |
searchRecencyFilter | noLimit | Zhipu recency window: noLimit / oneDay / oneWeek / oneMonth / oneYear (Zhipu modes) |
contentSize | medium | Zhipu snippet size: medium / high (Zhipu modes) |
searchDomainFilter | — | Zhipu domain allowlist, e.g. www.example.com (Zhipu modes) |
searchIntent | false | Zhipu intent recognition; off searches directly (zhipu-web-search only) |
searchPrompt | — | Zhipu chat search prompt; blank uses the official default (zhipu-chat-search only) |
reasoningEffort | low | Thinking effort (reasoning_effort) for the chat turn: low / high / max; low keeps thinking-only models like GLM-5.3-Flash fast (zhipu-chat-search only) |
responsesReasoningEffort | — (unset) | OpenAI-standard reasoning.effort for the responses turn: low / high; unset sends no reasoning parameter and follows the model's own mode (responses only) |
apiKeyEnv/baseURL/modelleft empty inherit the current mode's default. Endpoint and key-reference values fossilized into a section by the old schema defaults (the Qwen ones) yield to the current mode's default when you switch modes. A DeepSeek model name fossilized the same way yields only when you switch to a zhipu mode, whose endpoint cannot serve it. A deliberate1024output budget from an old schema is likewise treated as a fossil, while a1024set through the configuration page still works. Explicitly customized values are always honored.
Every key saved from the card follows one rule: a blank value clears the key so the mode's own default applies again, an omitted key is left untouched, and an invalid value is rejected with a message naming it. apiKey is the exception — blank keeps the stored secret.
Configuration page
The configuration page lives in the sidebar under Plugins → dsh-web-search-diy → the web-search-diy row's Configure (registered into the plugins.row.config slot introduced in dsh 0.1.6-alpha.2; the legacy Settings → Plugins → Plugin configuration page was removed in that release). The page matches the official plugin configuration pages: edits stage locally and only Save writes, while Discard reverts to the stored values. Saving takes effect immediately — no restart. Page copy follows Settings → Language (zh / en). The API key input is write-only: leave it blank to keep the stored key.
The protocol list puts Anthropic-compatible (Messages API + web_search, used by DeepSeek official) first, while the stored default remains responses. Switching the protocol fills in the new mode's official endpoint, model, and credential reference; a value belonging to the family being left follows the switch, and a value outside every known family (a gateway token, a custom name) is kept as typed. Because entering a mode whose bucket already holds the current values would otherwise look unchanged, the selected protocol counts as a pending change on its own: the mode switch and any edited parameters are written by the same Save, and the button is disabled only when the draft matches what the host holds.
Fields appear per mode, mirroring where each value actually applies: model and maxOutputTokens are hidden in zhipu-web-search (no model turn — count governs the result size there), searchIntent is offered only in zhipu-web-search, searchPrompt and reasoningEffort only in zhipu-chat-search, and apiVersion, maxUses, and anthropicThinking only in anthropic-messages. A rejected save keeps the page with the error in the footer, where the official pages report save failures.
Configuration page
The configuration page lives in the sidebar under Plugins → dsh-web-search-diy → the web-search-diy row's Configure (registered into the plugins.row.config slot introduced in dsh 0.1.6-alpha.2; the legacy Settings → Plugins → Plugin configuration page was removed in that release). The page matches the official plugin configuration pages: edits stage locally and only Save writes, while Discard reverts to the stored values. Saving takes effect immediately — no restart. Page copy follows Settings → Language (zh / en). The API key input is write-only: leave it blank to keep the stored key.
The protocol list puts Anthropic-compatible (Messages API + web_search, used by DeepSeek official) first, while the stored default remains responses. Switching the protocol fills in the new mode's official endpoint, model, and credential reference; a value belonging to the family being left follows the switch, and a value outside every known family (a gateway token, a custom name) is kept as typed. Because entering a mode whose bucket already holds the current values would otherwise look unchanged, the selected protocol counts as a pending change on its own: the mode switch and any edited parameters are written by the same Save, and the button is disabled only when the draft matches what the host holds.
Fields appear per mode, mirroring where each value actually applies: model and maxOutputTokens are hidden in zhipu-web-search (no model turn — count governs the result size there), searchIntent is offered only in zhipu-web-search, searchPrompt and reasoningEffort only in zhipu-chat-search, and apiVersion, maxUses, and anthropicThinking only in anthropic-messages. A rejected save keeps the page with the error in the footer, where the official pages report save failures.