dsh-web-search-bocha
DeepSeek Harness 的博查(Bocha)WebSearchProvider 与可安装的 profile 安装包。
bocha-ai
@bocha-ai
⬇ 2
★ 0
main
安装
dsh plugin --profile web add github:bocha-ai/dsh-web-search-bocha
需要可复现安装时,可在仓库后追加 #commit 固定提交。
DeepSeek Harness 的博查(Bocha)WebSearchProvider 与可安装的 profile 安装包。
该插件未提供要点说明,请参考仓库 README。
bochacordisdeepseek-harnessdshdsh-pluginweb-search
- 安装并启动 DeepSeek Harness:
npx @deepseek-ai/dsh web - 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
- 用 dsh plugins list 确认已安装,必要时重启 Harness 生效
插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。
| 代码仓库 | github.com/bocha-ai/dsh-web-search-bocha |
| 许可证 | MIT |
| 主要语言 | main |
| 下载量 | 2 |
| GitHub 星标 | 0 |
| 最近推送 | 2026-08-14 |
| 收录日期 | 2026-09-19 |
| 分类 | 工具与能力 |
事实信息来自公开插件目录快照(2026-10-01),介绍文案由本站再加工。
以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。
# @bocha-ai/dsh-web-search-bocha
English | [中文](README.zh.md)
A [Bocha Web Search](https://open.bocha.cn/)-backed `WebSearchProvider` and installable Profile bundle for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness). The package registers provider id `bocha`, calls Bocha's `POST /v1/web-search` endpoint, and carries a `dsh.bundle` patch that selects the provider after installation.
The package supplies search only. DeepSeek Harness continues to own the model-facing `web_search` tool, result limits, citations, provider selection, and error presentation through its [web capability](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/web/web).
## Install
Install the bundle into a Profile:
```sh
dsh plugin --profile web add @bocha-ai/dsh-web-search-bocha
```
Optionally inspect the composed configuration; this prints it and exits:
```sh
dsh --profile web --dump-config
```
Start the Web app with:
```sh
dsh --profile web
```
Configure the API key with either option below. You do not need both.
### Option 1: DSH credentials document
Store the key in `$DSH_HOME/.credentials.yaml` (normally `~/.dsh/.credentials.yaml`):
```yaml
BOCHA_API_KEY: your-api-key
```
On POSIX, the file must be owner-only:
```sh
chmod 600 ~/.dsh/.credentials.yaml
```
The plugin resolves this reference through the Harness credentials service for every search, so a stored key rotation applies to the next request without a restart.
### Option 2: Environment variable
For CI, containers, or a per-run override, export the key before starting Harness:
```sh
export BOCHA_API_KEY='your-api-key'
```
If both options configure `BOCHA_API_KEY`, the inherited environment variable takes precedence over the managed credentials document.
Removing the package removes its provider row and bundle layer:
```sh
dsh plugin --profile web remove @bocha-ai/dsh-web-search-bocha
```
## Bundle behavior
`cordis.patch.yml` replaces the base `web` row's complete config with `searchProvider: bocha` and inserts a `web-search-bocha` row that loads this package. Existing providers remain mounted, but `ctx.web` routes search to `bocha`. Profile, Harness-home, and command-line patch layers applied later can replace either row.
## Config
| Key | Default | Meaning |
|---|---|---|
| `apiKey` | — | Optional literal Bocha API key. It is redacted from settings descriptions, but the credentials service is preferred so no plaintext key enters a Profile patch. |
| `apiKeyEnv` | `BOCHA_API_KEY` | Credential reference resolved through the Harness credentials service for every search. |
| `baseURL` | `https://api.bocha.cn` | API base; `/v1/web-search` is appended. |
| `freshness` | `noLimit` | Time filter sent on every search: `noLimit`, `oneDay`, `oneWeek`, `oneMonth`, `oneYear`, one date such as `2025-04-06`, or a range such as `2025-01-01..2025-04-06`. |
| `summary` | `true` | Requests Bocha's longer per-page `summary`. |
| `count` | `10` | Default count when the Harness request has no `maxResults`; integer from 1 through 50. |
A later Profile patch can configure the inserted row without changing the package:
```yaml
- id: web-search-bocha
config:
freshness: 2025-01-01..2025-04-06
summary: true
count: 10
```
## Mapping and failures
The provider reads `data.webPages.value[]`. It maps `url` to `WebSearchSource.url`, `name` to `title`, `summary` to `snippet` with `snippet` as the fallback, and `datePublished` to `publishedAt`; an entry without a non-blank URL is dropped. Bocha does not return one generated answer for this endpoint, so `WebSearchResult.content` is omitted.
The request's `maxResults` overrides `count` and is capped at Bocha's maximum of 50 before the request is sent. The Harness web capability still enforces its own final source bound.
HTTP errors, provider-declared non-200 codes, network failures, and unprocessable response bodies surface as `WebError` `WEB_PROVIDER_ERROR`. Error messages retain Bocha's `log_id` when present. Abort-shaped failures surface as `WEB_ABORTED`, and redirects are rejected before their target is contacted.
The provider resolves the referenced credential at each search entry, so a key stored or rotated through the UI takes effect on the next request without restarting or re-registering the provider. A missing referenced credential surfaces as `WEB_PROVIDER_CREDENTIAL_MISSING`.
## Development
Install development dependencies, run the keyless tests, build, and inspect the npm payload:
```sh
npm install
npm test
npm run build
npm pack --dry-run
```
Run the live smoke only when a Bocha key is available:
```sh
BOCHA_API_KEY='your-api-key' npm run test:e2e
```
## Model Experience
Indirectly, through DeepSeek Harness `dsh-tool-web`, which renders this provider's bounded URLs, titles, summaries or snippets, and publication dates under the stable `web_search` tool contract.
#### KV Cache effect
No direct invalidation; the Harness tool consumer owns any request-prefix changes.
## Known Limitations and Deferred Work
- **Current upstream DSH does not expose third-party search settings in its built-in Plugins UI** — that card and the Host settings allowlist are internal to DSH. Configure this package through its Profile row and store `BOCHA_API_KEY` in the credentials document or launch environment; publishing this npm package does not require a patched DSH checkout.
- **Freshness is deployment configuration rather than a model-facing argument** — every request from one mounted provider uses the same `freshness` value because the provider-neutral Harness request currently carries only `query` and `maxResults`.
- **Bocha-specific `siteName` and other media fields are omitted** — the portable Harness source type has no site-name, image, or video fields.
- **One API call returns at most 50 sources** — a larger Harness `maxResults` request is capped at Bocha's documented maximum before transport.
数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。