dsh-web-search
Host and Web client plugin for selecting and routing DeepSeek Harness web_search backends.
English
What it does
The Host half registers one ctx.web provider named dsh-web-search-selected. A persisted web-search setting chooses the live backend. The Web client adds a dedicated Settings → Web search section and saves the selection through the Host settings scope.
Request path:
web_search
-> ctx.web
-> dsh-web-search-selected
-> selected backend
Built-in backends:
| ID | Behavior |
|---|---|
openai-responses |
OpenAI Responses API with the native web_search tool |
deepseek-official |
DeepSeek native web search protocol |
The plugin identity is the router, not any one model or vendor.
Install
dsh plugin --profile web add github:RailgunHamster/dsh-web-search
dsh plugin --profile web install
Restart the Web profile:
dsh web
Or add it to the Web profile package.json by hand:
{
"dependencies": {
"dsh-web-search": "git+https://github.com/RailgunHamster/dsh-web-search.git"
},
"dsh": {
"profile": {
"bundles": [
"dsh-web-search"
]
}
}
}
cd "$env:USERPROFILE\.dsh\profiles\web"
pnpm install
dsh web
The bundled cordis.patch.yml then:
- Disables the shipped
web-search-deepseekprovider. - Points
@deepseek-ai/dsh-websearchProvideratdsh-web-search-selected. - Inserts
dsh-web-searchinto the current composition.
Configuration
Plugin config (and the settings namespace web-search) accepts:
| Key | Default | Meaning |
|---|---|---|
provider |
openai-responses |
Selected backend |
responsesApiKeyEnv |
OPENAI_API_KEY |
Credential / env name for Responses search |
responsesBaseURL |
https://api.openai.com/v1 |
Responses API base URL |
responsesModel |
gpt-4o |
Model that exposes tools: [{ type: "web_search" }] |
responsesMaxTokens |
1024 |
max_output_tokens for Responses search |
deepseekApiKeyEnv |
DEEPSEEK_API_KEY |
Credential / env name for DeepSeek search |
deepseekBaseURL |
https://api.deepseek.com/anthropic/v1 |
DeepSeek Anthropic-compatible base URL |
deepseekModel |
deepseek-v4-flash |
DeepSeek search model |
deepseekApiVersion |
2023-06-01 |
anthropic-version header |
deepseekMaxTokens |
4096 |
DeepSeek max_tokens |
deepseekMaxUses |
5 |
DeepSeek web_search max_uses |
Provide keys through DSH credentials or the launching environment. Do not put real keys in Git, settings.yaml, or this README.
Example plugin row:
- id: web-search
config:
provider: openai-responses
responsesApiKeyEnv: OPENAI_API_KEY
responsesBaseURL: https://api.openai.com/v1
responsesModel: gpt-4o
Switching backends in Settings → Web search saves immediately and applies to later web_search calls. A DSH restart is not required for that switch.
Verify
dsh --profile web --dump-config | Select-String -Pattern 'searchProvider|web-search-deepseek|web-search'
Expected:
searchProvider: dsh-web-search-selected
web-search-deepseek: disabled: true
web-search: dsh-web-search
Then run a normal web_search. The default Responses backend posts:
POST {responsesBaseURL}/responses
tools: [{ "type": "web_search" }]
The plugin maps returned text and url_citation annotations to Harness content and sources.
Development
Host or cordis.patch.yml changes need a full DSH Web restart, then a browser refresh. Client changes hot-reload only if the profile Web watcher is running.
Do not commit:
node_modules/.dsh/settings.yaml- credential files
.envfiles- API keys, private keys, or session data
License
MIT
中文
功能
Host 侧注册一个名为 dsh-web-search-selected 的 ctx.web provider。持久化的 web-search 设置决定当前搜索后端。Web 客户端提供独立的 设置 → 联网搜索 页面,选择会通过 Host settings scope 自动保存。
请求路径:
web_search
-> ctx.web
-> dsh-web-search-selected
-> 当前选中的 backend
内置 backend:
| ID | 行为 |
|---|---|
openai-responses |
调用 OpenAI Responses API 的原生 web_search 工具 |
deepseek-official |
使用 DeepSeek 原生 web search 协议 |
插件本身是路由器,不绑定某个模型或厂商。
安装
dsh plugin --profile web add github:RailgunHamster/dsh-web-search
dsh plugin --profile web install
然后重启 Web profile:
dsh web
也可以手动改 Web profile 的 package.json:
{
"dependencies": {
"dsh-web-search": "git+https://github.com/RailgunHamster/dsh-web-search.git"
},
"dsh": {
"profile": {
"bundles": [
"dsh-web-search"
]
}
}
}
cd "$env:USERPROFILE\.dsh\profiles\web"
pnpm install
dsh web
插件自带的 cordis.patch.yml 会:
- 禁用 shipped 的
web-search-deepseekprovider。 - 将
@deepseek-ai/dsh-web的searchProvider指向dsh-web-search-selected。 - 把
dsh-web-search插入当前 composition。
配置
插件配置(以及 settings namespace web-search)支持:
| 字段 | 默认值 | 含义 |
|---|---|---|
provider |
openai-responses |
当前 backend |
responsesApiKeyEnv |
OPENAI_API_KEY |
Responses 搜索使用的凭据 / 环境变量名 |
responsesBaseURL |
https://api.openai.com/v1 |
Responses API 根地址 |
responsesModel |
gpt-4o |
支持 tools: [{ type: "web_search" }] 的模型 |
responsesMaxTokens |
1024 |
Responses 搜索的 max_output_tokens |
deepseekApiKeyEnv |
DEEPSEEK_API_KEY |
DeepSeek 搜索使用的凭据 / 环境变量名 |
deepseekBaseURL |
https://api.deepseek.com/anthropic/v1 |
DeepSeek Anthropic 兼容根地址 |
deepseekModel |
deepseek-v4-flash |
DeepSeek 搜索模型 |
deepseekApiVersion |
2023-06-01 |
anthropic-version 请求头 |
deepseekMaxTokens |
4096 |
DeepSeek max_tokens |
deepseekMaxUses |
5 |
DeepSeek web_search 的 max_uses |
密钥只能放在 DSH credentials 或启动环境里,不要写入 Git、settings.yaml 或本文。
插件行示例:
- id: web-search
config:
provider: openai-responses
responsesApiKeyEnv: OPENAI_API_KEY
responsesBaseURL: https://api.openai.com/v1
responsesModel: gpt-4o
在 设置 → 联网搜索 里切换 backend 会立刻保存,并作用于之后的 web_search,不必为了切换而重启 DSH。
验证
dsh --profile web --dump-config | Select-String -Pattern 'searchProvider|web-search-deepseek|web-search'
预期看到:
searchProvider: dsh-web-search-selected
web-search-deepseek: disabled: true
web-search: dsh-web-search
然后发一次普通 web_search。默认 Responses backend 会请求:
POST {responsesBaseURL}/responses
tools: [{ "type": "web_search" }]
插件把返回文本和 url_citation 映射为 Harness 的 content 与 sources。
开发
Host 代码或 cordis.patch.yml 改动后需要完整重启 DSH Web,再刷新浏览器。只有 profile 的 Web watcher 在跑时,Client 改动才会热更新。
不要提交:
node_modules/.dsh/settings.yaml- credentials 文件
.env文件- API key、私钥或 session 数据
许可证
MIT
No comments yet. Be the first to write one.