runfali/dsh-web-search-custom ↗★ 0
dsh-web-search-custom
Generic URL + optional API key search provider for the DeepSeek Harness web profile (ctx.web), with an in-settings configuration card. Zero-intrusion bundle plugin; works with any SearXNG-compatible JSON endpoint.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:runfali/dsh-web-search-custom说明文档
阅读完整 README ↗在设置页配置(推荐)
打开 Web UI 的 设置 → 插件配置,会看到「自定义搜索(web-search-custom)」卡片,展开后可直接填写:
- 搜索 URL(支持
{query}/{apiKey}占位符) - API Key(可留空;非空时默认以
Authorization: Bearer发送) - 请求方法、POST body 模板、额外请求头(JSON)、超时
- 结果字段映射(
resultsPath/urlField/titleField/snippetField/publishedField)
保存后写回 ~/.dsh/settings.yaml 的 web-search-custom: 段并热生效;「已覆盖 / 重置」状态与官方插件卡片一致。
配置项一览
| 字段 | 默认值 | 说明 |
|---|---|---|
url | 本机 SearXNG | 搜索地址。支持 {query}、{apiKey} 占位符(自动 URL 编码);GET 且不含 {query} 时自动补 q= 参数 |
apiKey | 空 | 可选。非空时默认以 Authorization: Bearer 发送;若 url 或 POST body 里已有 {apiKey} 则不再额外加头 |
method | GET | GET 或 POST |
body | {"query":"{query}"} | POST body 模板,支持 {query} / {apiKey} |
headers | {} | 额外请求头,JSON 字符串 |
authHeader | Authorization | apiKey 使用的请求头名 |
authScheme | Bearer | 鉴权 scheme;填空字符串则裸发 key 值 |
timeoutMs | 30000 | 单次请求超时 |
resultsPath | results | JSON 中结果数组的点路径,如 data.results |
urlField / titleField / snippetField / publishedField | url / title / content / publishedDate | 结果字段名映射(SearXNG 默认即 content、publishedDate) |
其他配置方式
profile 用户补丁层(~/.dsh/profiles/web/cordis.patch.yml)
- id: web-search-custom
config:
url: 'http://127.0.0.1:8080/search?format=json&q={query}'
apiKey: ''
method: GET
body: '{"query":"{query}"}'
headers: '{}'
authHeader: Authorization
authScheme: Bearer
timeoutMs: 30000
resultsPath: results
urlField: url
titleField: title
snippetField: content
publishedField: publishedDate
注意:补丁是整段替换
config,覆盖时要写全所有项。
环境变量(不改文件,优先级高于设置页配置)
| 变量 | 说明 |
|---|---|
WEB_SEARCH_CUSTOM_URL | 覆盖搜索 URL |
WEB_SEARCH_CUSTOM_API_KEY | 覆盖 API key(推荐用于含 secret 的场景) |
WEB_SEARCH_CUSTOM_HEADERS | 额外请求头,JSON 字符串 |
WEB_SEARCH_CUSTOM_TIMEOUT_MS | 超时毫秒数 |
环境变量(不改文件,优先级高于设置页配置)
| 变量 | 说明 |
|---|---|
WEB_SEARCH_CUSTOM_URL | 覆盖搜索 URL |
WEB_SEARCH_CUSTOM_API_KEY | 覆盖 API key(推荐用于含 secret 的场景) |
WEB_SEARCH_CUSTOM_HEADERS | 额外请求头,JSON 字符串 |
WEB_SEARCH_CUSTOM_TIMEOUT_MS | 超时毫秒数 |