runfali/dsh-web-search-custom0

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.

包名
dsh-web-search-custom
版本
0.2.0
许可证
MIT
最近更新
2026年8月18日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:runfali/dsh-web-search-custom

在设置页配置(推荐)

打开 Web UI 的 设置 → 插件配置,会看到「自定义搜索(web-search-custom)」卡片,展开后可直接填写:

  • 搜索 URL(支持 {query} / {apiKey} 占位符)
  • API Key(可留空;非空时默认以 Authorization: Bearer 发送)
  • 请求方法、POST body 模板、额外请求头(JSON)、超时
  • 结果字段映射(resultsPath / urlField / titleField / snippetField / publishedField

保存后写回 ~/.dsh/settings.yamlweb-search-custom: 段并热生效;「已覆盖 / 重置」状态与官方插件卡片一致。

配置项一览

字段默认值说明
url本机 SearXNG搜索地址。支持 {query}{apiKey} 占位符(自动 URL 编码);GET 且不含 {query} 时自动补 q= 参数
apiKey可选。非空时默认以 Authorization: Bearer 发送;若 url 或 POST body 里已有 {apiKey} 则不再额外加头
methodGETGETPOST
body{"query":"{query}"}POST body 模板,支持 {query} / {apiKey}
headers{}额外请求头,JSON 字符串
authHeaderAuthorizationapiKey 使用的请求头名
authSchemeBearer鉴权 scheme;填空字符串则裸发 key 值
timeoutMs30000单次请求超时
resultsPathresultsJSON 中结果数组的点路径,如 data.results
urlField / titleField / snippetField / publishedFieldurl / title / content / publishedDate结果字段名映射(SearXNG 默认即 contentpublishedDate

其他配置方式

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超时毫秒数