@kamitobi/dsh-multi-search
⚠️ Disclaimer: This is a community plugin and is NOT affiliated with,
endorsed by, or maintained by DeepSeek AI. For the official project, see
deepseek-ai/deepseek-harness.
English · 中文
English
Use DashScope, MiMo, MiniMax, Zhipu, or any third-party search API in DeepSeek Harness.
DSH's built-in web_search tool only works with DeepSeek's proprietary search API. This plugin replaces it with a drop-in adapter that speaks DashScope (阿里云百炼), Xiaomi MiMo, MiniMax, Zhipu AI (GLM), or any provider you build — so your agent can search the web using the API you already have.
The Problem
DSH ships one search provider (deepseek-official) that:
- Speaks Anthropic Messages protocol — not OpenAI Chat Completions.
- Requires a paid DeepSeek key and routes through DeepSeek's server.
- Cannot be swapped for local models or alternative providers.
If you use Qwen models via DashScope, MiMo via Xiaomi, MiniMax, Zhipu GLM, or any other provider with web search capabilities, the built-in search is useless to you. dsh-multi-search fixes that.
Install
dsh plugin --profile web add @kamitobi/dsh-multi-search
Setup
Run the interactive setup wizard:
npx -p @kamitobi/dsh-multi-search dsh-multi-search-setup
The wizard will:
- Auto-detect your DSH profiles
- Let you choose a search provider (MiMo / DashScope)
- Prompt for your API key (paste directly or type an env var name)
- Optionally set a custom base URL
- Write the config to your profile's
cordis.patch.yml
If you used an env var, make sure it's exported (in ~/.bashrc or ~/.zshrc):
export XIAOMI_API_KEY='your-api-key-here'
Then restart DSH:
dsh web
Reconfigure
To change provider, API key, or other settings, run setup again:
npx -p @kamitobi/dsh-multi-search dsh-multi-search-setup
It will show your current config and ask if you want to reconfigure.
Prefer manual config? Click to expand
Edit ~/.dsh/profiles/web/cordis.patch.yml directly:
- id: multi-search
config:
activeProvider: mimo
mimo:
apiKeyEnv: 'XIAOMI_API_KEY'
model: 'mimo-v2.5'
- id: web
config:
searchProvider: multi-search
Then export the env var and restart DSH.
Configuration
API Key — choose ONE of:
| Method | Config | Notes |
|---|
| Env var (recommended) | apiKeyEnv: 'MY_KEY' | Key stays in your shell, not in YAML |
| Direct key | apiKey: 'sk-xxx' | Simpler, but stored in plaintext |
Provider options:
| Field | Type | Default | Description |
|---|
activeProvider | string | mimo | mimo / dashscope / minimax / zhipu |
model | string | provider default | Model identifier |
baseURL | string | provider default | Custom API endpoint |
maxResults | number | 5 | Max search results |
DashScope-specific:
| Field | Type | Default | Description |
|---|
forceSearch | boolean | false | Always search |
searchStrategy | string | max | turbo / max / agent |
MiMo-specific:
| Field | Type | Default | Description |
|---|
forceSearch | boolean | true | Always search |
maxKeyword | number | 3 | Max keywords per search round |
Adding a New Provider
The plugin uses a provider registry pattern. Adding a new search backend takes ~20 lines:
// src/providers/tavily.ts
import type { WebSearchProvider, WebSearchRequest, WebSearchResult } from '@deepseek-ai/dsh-web'
import type { BaseProviderConfig } from '../types.js'
export class TavilySearchProvider implements WebSearchProvider {
readonly id = 'multi-search'
constructor(private readonly config: BaseProviderConfig) {}
available(): boolean {
return Boolean(this.config.apiKey)
}
async search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult> {
// Call your search API, return { content, sources, truncated }
throw new Error('Not implemented')
}
}
Then register it in src/index.ts:
import { TavilySearchProvider } from './providers/tavily.js'
registerProvider('tavily', {
create: (config) => new TavilySearchProvider(config),
})
See the built-in DashScope and MiMo providers as reference.
Architecture
Agent calls web_search("query")
│
▼
DSH web seam (ctx.web)
│
▼
dsh-multi-search plugin ← replaces deepseek-official
│
┌────┴────┐
│ │
DashScope MiMo
The plugin overrides DSH's searchProvider config to point at its own provider — the web_search tool name stays the same, but requests go through your configured third-party API instead of DeepSeek's.
Troubleshooting
| Problem | Solution |
|---|
| "Provider not available (missing API key)" | Set apiKey in config, or set apiKeyEnv + export the env var |
| Search returns empty sources | Try forceSearch: true; check if your model supports enable_search / web_search |
| "Multiple usable web providers" | Ensure searchProvider: multi-search is set in web seam config (the plugin does this automatically) |
License
MIT
Credits
中文
在 DeepSeek Harness 中使用 DashScope、MiMo 或任何第三方搜索 API。
DSH 内置的 web_search 工具只能使用 DeepSeek 的专有搜索 API。本插件将其替换为一个即插即用的适配器,支持 DashScope(阿里云百炼)、小米 MiMo 或你自行开发的搜索后端 — 让你的 Agent 用已有的 API 联网搜索。
为什么需要这个插件?
DSH 内置的搜索提供商(deepseek-official)有以下限制:
- 使用 Anthropic Messages 协议,不是 OpenAI Chat Completions。
- 需要 付费 DeepSeek API Key,请求走 DeepSeek 服务器。
- 不支持本地模型或其他替代提供商。
如果你用的是 DashScope 上的 Qwen 模型、小米 MiMo,或其他支持搜索的提供商,内置搜索对你来说毫无用处。dsh-multi-search 解决了这个问题。
安装
dsh plugin --profile web add @kamitobi/dsh-multi-search
配置
运行交互式配置向导:
npx -p @kamitobi/dsh-multi-search dsh-multi-search-setup
向导会:
- 自动检测你的 DSH profiles
- 让你选择搜索提供商(MiMo / DashScope)
- 提示输入 API Key(直接粘贴或输入环境变量名)
- 可选设置自定义 API 端点
- 将配置写入 profile 的
cordis.patch.yml
如果使用了环境变量,确保在 ~/.bashrc 或 ~/.zshrc 中导出:
export XIAOMI_API_KEY='你的 API Key'
然后重启 DSH:
dsh web
修改配置
要更换提供商、修改 API Key 或其他设置,重新运行向导即可:
npx -p @kamitobi/dsh-multi-search dsh-multi-search-setup
向导会显示当前配置,确认后即可修改。
想手动配置?点击展开
直接编辑 ~/.dsh/profiles/web/cordis.patch.yml:
- id: multi-search
config:
activeProvider: mimo
mimo:
apiKeyEnv: 'XIAOMI_API_KEY'
model: 'mimo-v2.5'
- id: web
config:
searchProvider: multi-search
然后导出环境变量,重启 DSH。
配置说明
API Key — 二选一:
| 方式 | 配置 | 说明 |
|---|
| 环境变量(推荐) | apiKeyEnv: 'MY_KEY' | Key 留在 shell 中,不写入 YAML |
| 直接填写 | apiKey: 'sk-xxx' | 更简单,但明文存储 |
提供商选项:
| 字段 | 类型 | 默认值 | 说明 |
|---|
activeProvider | string | mimo | mimo / dashscope / minimax / zhipu |
model | string | 提供商默认 | 模型标识符 |
baseURL | string | 提供商默认 | 自定义 API 端点 |
maxResults | number | 5 | 最大搜索结果数 |
DashScope 专属:
| 字段 | 类型 | 默认值 | 说明 |
|---|
forceSearch | boolean | false | 强制搜索 |
searchStrategy | string | max | turbo / max / agent |
MiMo 专属:
| 字段 | 类型 | 默认值 | 说明 |
|---|
forceSearch | boolean | true | 强制搜索 |
maxKeyword | number | 3 | 每轮最大关键词数 |
添加新搜索提供商
插件采用 Provider 注册表 模式,添加新搜索后端只需 ~20 行代码:
// src/providers/tavily.ts
import type { WebSearchProvider, WebSearchRequest, WebSearchResult } from '@deepseek-ai/dsh-web'
import type { BaseProviderConfig } from '../types.js'
export class TavilySearchProvider implements WebSearchProvider {
readonly id = 'multi-search'
constructor(private readonly config: BaseProviderConfig) {}
available(): boolean {
return Boolean(this.config.apiKey)
}
async search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult> {
// 调用你的搜索 API,返回 { content, sources, truncated }
throw new Error('Not implemented')
}
}
然后在 src/index.ts 中注册:
import { TavilySearchProvider } from './providers/tavily.js'
registerProvider('tavily', {
create: (config) => new TavilySearchProvider(config),
})
参考内置的 DashScope 和 MiMo 实现。
工作原理
Agent 调用 web_search("查询")
│
▼
DSH web seam (ctx.web)
│
▼
dsh-multi-search 插件 ← 替换 deepseek-official
│
┌────┴────┐
│ │
DashScope MiMo
插件覆盖了 DSH 的 searchProvider 配置,指向自己的提供商 — web_search 工具名不变,但请求走的是你配置的第三方 API,而不是 DeepSeek 的。
常见问题
| 问题 | 解决方案 |
|---|
| "Provider not available (missing API key)" | 在配置中设置 apiKey,或设置 apiKeyEnv + 导出环境变量 |
| 搜索返回空结果 | 尝试 forceSearch: true;检查模型是否支持 enable_search / web_search |
| "Multiple usable web providers" | 确保 web seam 配置中设置了 searchProvider: multi-search(插件会自动处理) |
许可证
MIT
致谢