dsh-web-search-bing
文件与数据 活跃维护

dsh-web-search-bing

sqs404/dsh-web-search-bing

支持一键切换Bing免密钥抓取与DeepSeek官方联网搜索,配套web_fetch直连抓取对应提供商,无需额外配置即可快速获取精准的搜索结果。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
27 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:sqs404/dsh-web-search-bing
git clone https://github.com/sqs404/dsh-web-search-bing.git
git clone git@github.com:sqs404/dsh-web-search-bing.git
README.md main

dsh-web-search-bing · DeepSeek Harness 搜索切换插件

一个开关,两个搜索后端:免密钥 Bing 抓取DeepSeek 官方联网搜索,热重载切换。
配套 dsh-web-fetch-direct,让模型侧的 web_fetch 工具可用。

DeepSeek Harness(DSH)的 ctx.web seam 提供可切换的搜索提供商:

  • (默认):无 API Key 的 Bing SERP 抓取(www.bing.com,失败自动兜底 cn.bing.com);
  • :DeepSeek 官方搜索(Anthropic 兼容 Messages API + 原生 web_search 工具),需要 DEEPSEEK_API_KEY

开关即设置项 web-search-bing.enabled,每次搜索调用时读取,切换立即生效、无需重启。


安装

方式一:一键脚本

# 假设 DSH 便携版在 C:\DeepSeek Harness 便携版
powershell -ExecutionPolicy Bypass -File .\install.ps1 -DshRoot "C:\DeepSeek Harness 便携版"

脚本把两个插件包复制到 data/profiles/node_modules/@deepseek-ai/,并在 data/profiles/web/cordis.patch.yml
追加注册与接线配置(按标记判重、可重复执行;自动移除模板遗留的空列表占位符 [])。
-DshRoot 缺省时自动探测当前目录或其父目录。

方式二:UI 开关补丁(可选)

DSH 0.1.0-rc.6 的设置页不会显示第三方插件的开关——dsh-host-apiproxy 有硬编码白名单
WEB_SETTINGS_NAMESPACES,「设置 → 插件」页的卡片也是硬编码的。执行 apply-ui-patch.ps1
重启 DSH 后,即可在「设置 → 插件 → 插件配置」看到「网页搜索(Bing)」卡片与开关:

powershell -ExecutionPolicy Bypass -File .\apply-ui-patch.ps1 -DshRoot "C:\DeepSeek Harness 便携版"

补丁幂等、带 node --check 语法自检;目标文件结构与 DSH 0.1.0-rc.6 不匹配时会报错且不做任何写入。
不打这个补丁不影响功能,开关仍可通过编辑 settings.yaml 控制(见下文)。

手动安装

  1. packages/dsh-web-search-bingpackages/dsh-web-fetch-direct 整个文件夹复制到
    data/profiles/node_modules/@deepseek-ai/(与其它 @deepseek-ai/* 包并列);
  2. config/cordis.patch.example.yml 的内容合并进 data/profiles/web/cordis.patch.yml
    (已有相同 id 的条目请手动合并,避免重复);
  3. 重启 DSH。

使用:切换搜索后端

开关即设置项 web-search-bing.enabled,两种切法任选:

A. 编辑 data/settings.yaml(任何安装方式都可用,保存后热重载)

web-search-bing:
  enabled: true   # true=Bing 免密钥抓取(默认);false=DeepSeek 官方搜索(需 DEEPSEEK_API_KEY)

B. 设置页开关(需先打 UI 补丁并重启)
「设置 → 插件 → 插件配置 → 网页搜索(Bing)」→ 切换 → 保存,立即生效。

验证:让模型执行一次 web_search——

  • Bing 后端:返回抓取解析的网页来源,无需任何 Key;
  • 官方后端:返回 DeepSeek 原生搜索结果;Key 缺失或无效时你会看到 DeepSeek 的鉴权错误。

目录结构

dsh-web-search-bing/
├── README.md                        # 本说明
├── LICENSE                          # MIT 许可证
├── install.ps1                      # 一键安装脚本(幂等,可重复执行)
├── apply-ui-patch.ps1               # UI 开关补丁(可选,见「方式二」)
├── packages/
│   ├── dsh-web-search-bing/         # 搜索切换插件
│   └── dsh-web-fetch-direct/        # web_fetch 直连抓取插件
└── config/
    └── cordis.patch.example.yml     # 手动安装用的 cordis.patch.yml 配置片段

环境要求

  • DSH 0.1.0-rc.6+,便携版 / 源码版均可;
  • 官方后端(可选)需要 DEEPSEEK_API_KEY;纯用 Bing 后端不需要任何 Key

注意事项

  • 包名带 @deepseek-ai/ 前缀是为了与 DSH 官方插件同命名空间共存、被 cordis 按包名解析,请勿改名;
  • web_fetch 抓取知乎 / CSDN 等硬反爬站点可能失败,插件会明确拒答并提示换源;
  • MIT 许可证;非 DeepSeek 官方组件;Bing 抓取请遵守目标站点服务条款与当地法律。