- Início
- Plugins
- Ferramentas e funções
- dsh-web-search-openai
dsh-web-search-openai
htcqp802/dsh-web-search-openai
OpenAI-compatible web search provider for the built-in web_search tool: one baseURL/apiKey/model config powers Qwen Token Plan, OpenAI and any Responses API gateway.
Instalar
dsh plugin --profile web add github:htcqp802/dsh-web-search-openaiREADME
dsh-web-search-openai
OpenAI-compatible web search provider for DeepSeek Harness (DSH).
It plugs into the harness ctx.web seam and powers the built-in web_search tool through any gateway that
implements the OpenAI Responses API with the built-in web_search tool.
How it works
Your chat LLM (e.g. deepseek-v4) decides to call the web_search tool; the tool executes through the
ctx.web seam, which routes to the provider configured here (e.g. qwen3.7-plus + your Qwen Token Plan key).
Search and conversation models are fully decoupled — no model switching, no manual steps.
you ──> chat LLM (deepseek-v4, …)
│ decides it needs live info
▼
web_search tool (model-agnostic)
│ ctx.web seam ──> configured provider
▼
this provider: POST {baseURL}/responses
tools: [{ type: "web_search" }]
│
▼
qwen3.7-plus / any compatible model ──> real search results
│
▼
chat LLM answers grounded in the results
Verified configuration
| Field | Value |
|---|---|
baseURL | https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1 (Qwen Token Plan CN) |
apiKeyEnv | QWEN_TOKEN_PLAN_CN_API_KEY |
model | qwen3.7-plus (also qwen3.7-max, qwen3.8-max) |
Why Responses API? Built-in web search on Qwen Token Plan only triggers through the Responses API with an explicit
tools: [{type: "web_search"}]declaration. The Chat Completionsenable_searchflag is silently ignored on that gateway. OpenAI and most OpenAI-compatible gateways expose the same shape.
Installation
Published as an npm package; one command once published:
dsh plugin add dsh-web-search-openai
For a local checkout (development), add it as a profile dependency and bundle:
cd ~/.dsh/profiles/web
pnpm add file:/path/to/dsh-web-search-openai
then add the package name to the dsh.profile.bundles list in profiles/web/package.json
(append it after the shipped bundles) and restart the app. The bundle's cordis.patch.yml
registers the provider and switches the web service's searchProvider to openai-search
— no shipped file is modified.
Configuration
In-GUI configuration card (v0.2+)
Install the plugin and open Settings → Plugins → Plugin config: the
dsh-web-search-openai card edits endpoint, credential reference, model,
maxOutputTokens, and the API key (stored through the credentials service,
never in config or code). Values take effect immediately — no restart needed.
Runtime precedence: UI-managed file ($DSH_HOME/dsh-web-search-openai.json)
web-search-openai:settings section > package defaults.
Configuration
Provider config lives in the web-search-openai settings section (or the plugin row in your composition):
web-search-openai:
baseURL: https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
apiKeyEnv: QWEN_TOKEN_PLAN_CN_API_KEY
model: qwen3.7-plus
| Key | Default | Meaning |
|---|---|---|
apiKey | unset | Literal API key (prefer apiKeyEnv; secrets never enter config). |
apiKeyEnv | QWEN_TOKEN_PLAN_CN_API_KEY | Credential reference resolved per search via the ctx.credentials seam, falling back to the launching environment. |
baseURL | Qwen Token Plan CN | OpenAI-compatible base URL (no trailing /); /responses is appended. |
model | qwen3.7-plus | Any model exposing the web_search tool on your gateway. |
maxOutputTokens | 1024 | Generated-token cap for one search call (the search itself is not truncated). |
API keys
Store the key through the standard harness credential paths — the Web Models settings page,
~/.dsh/.credentials.yaml, or the launching environment — under your apiKeyEnv name.
Billing notes
Each web_search call is a full model turn on the search gateway (reasoning + tool use + grounded answer,
roughly 3–4k tokens). On Qwen Token Plan, the built-in tools are billed per successful call and deducted
from your plan Credits. The chat model's tokens are billed separately.
Smoke test
cd dsh-web-search-openai
npm install
QWEN_TOKEN_PLAN_CN_API_KEY=sk-... node scripts/smoke.mjs "2025年诺贝尔物理学奖得主是谁?"
Plugin surface
- Registers a search provider (
id: openai-search) onctx.webviaregisterSearchProvider. - Registers no model-facing tools of its own; the shipped
web_searchtool stays the only entry point. - Response mapping is strict: a response without a
web_search_callblock fails withWEB_PROVIDER_ERRORinstead of scraping prose. Sources are deduped by URL;url_citationannotations add titles when present. - Error codes follow the seam vocabulary:
WEB_PROVIDER_CREDENTIAL_MISSING,WEB_PROVIDER_ERROR,WEB_ABORTED.
Development / publishing
npm install
node scripts/smoke.mjs # requires a key in the environment
npm publish # after bumping version
MIT licensed. Fork, adapt, and swap baseURL/apiKeyEnv/model to point at any compatible gateway.
Plugins relacionados
archify (deepseek-harness)
tt-a1i/archify
WeKnora (dsh-weknora)
tencent/weknora
weknora
tencent/weknora
BrowserSkill (dsh-plugin-browserskill)
tencent/browserskill