dsh-web-search-deepseek/packages/web/web-search-deepseek官方

175.3kStar19.0kFork0Issue752Watching

为 dsh 的 ctx.web 提供 DeepSeek 原生网页搜索能力,通过 Anthropic 兼容 API 调用 web_search server tool,解析结构化搜索结果而非抓取网页内容

机审证据安装命令仓库已核验dsh-plugin Topic许可证READMEAI 百科

此插件是大仓库 deepseek-ai/deepseek-harness 的子包,星数与活跃度统计的是整个仓库。

语言
TypeScript
License
MIT
分支
master
ai-agentscordisdshdsh-plugin

安装

$ dsh plugin --profile web add npm:@deepseek-ai/dsh-web-search-deepseek

在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程

对话式安装

帮我安装 DeepSeek Harness 插件 deepseek-ai/deepseek-harness/packages/web/web-search-deepseek:先查看仓库 https://github.com/deepseek-ai/deepseek-harness 确认安全性,然后执行安装命令并验证插件加载成功。

把这段指令粘贴给 DSH Web GUI 里的助手,由它代你完成安装与验证。

English | 中文

A DeepSeek-backed WebSearchProvider for the harness web capability seam (ctx.web). It calls DeepSeek's Anthropic-compatible Messages API (POST {baseURL}/messages) with the native web_search_20250305 server tool enabled, and maps the structured web_search_tool_result blocks DeepSeek returns into the seam's normalized WebSearchResult.

This is an implementation package: it registers a provider into ctx.web, resolves its credential for each search through the optional ctx.credentials seam, records the auxiliary request in the initiating Agent session when one exists, and does not register a model-facing tool. Like @deepseek-ai/dsh-llm-deepseek, it is a function/namespace plugin (inject: ['web']). The Anthropic wire shape is a provider-private detail — it does not make this provider depend on ctx.llm.

How it differs from a dedicated search endpoint

Exa and Perplexity expose dedicated search endpoints; DeepSeek does not. Instead this provider issues a full Messages model call carrying the web_search server tool, so one search costs a complete model turn in latency and tokens — heavier than a pure retrieval endpoint. DeepSeek runs the search server-side and returns structured web_search_tool_result blocks; the provider parses those blocks and never scrapes URLs out of model prose.

Strict mode: if the response carries no web_search_tool_result block (native search did not trigger), the provider throws WebError WEB_PROVIDER_ERROR rather than degrading to prose-scraping.

It reuses the DEEPSEEK_API_KEY credential reference (no new secret) but not $DEEPSEEK_BASE_URL: the search endpoint is the Anthropic-compatible base (https://api.deepseek.com/anthropic/v1), distinct from the chat-completions base (https://api.deepseek.com) the LLM adapter uses. A mounted credentials service is authoritative; without one, the provider falls back to the launching process environment. The reference is resolved for each search, so a key stored or rotated by the Web Models page reaches the next call without a restart.

Config

KeyDefaultMeaning
apiKeyomittedLiteral DeepSeek API key. Prefer apiKeyEnv so no secret enters configuration; a non-empty literal wins.
apiKeyEnvDEEPSEEK_API_KEYCredential reference resolved for each search through ctx.credentials, or from the process environment when that seam is absent. A missing value fails the call as WEB_PROVIDER_CREDENTIAL_MISSING.
baseURLhttps://api.deepseek.com/anthropic/v1Anthropic-compatible endpoint base; /messages is appended. Falls back to $DEEPSEEK_SEARCH_BASE_URL from any environment layer; do not reuse $DEEPSEEK_BASE_URL, which belongs to the chat-completions LLM adapter. An unparseable value makes the provider unavailable.
modeldeepseek-v4-flashAnthropic-format model name.
apiVersion2023-06-01anthropic-version header value.
maxTokens4096Positive-integer upper bound on generated tokens for the Messages request.
maxUses5Positive-integer maximum web_search server-tool uses per request.
- id: web-search-deepseek
  name: '@deepseek-ai/dsh-web-search-deepseek'
  config:
    apiKeyEnv: DEEPSEEK_API_KEY
    baseURL: https://gateway.internal/anthropic/v1

The entry above is the base layer of the web-search-deepseek Settings section: a user layer over it reaches the NEXT search, because the provider projects the section per call rather than capturing it at registration. The seam's provider selection therefore never flickers when an endpoint or model changes. apiKey carries role('secret'), so it never rides a describe() response in any layer — a configuration surface learns only whether the credentials domain holds a value for the reference apiKeyEnv names, never whether a layer carries a literal key.

Mapping

DeepSeek returns no provider-generated answer content this provider trusts as content, so content is omitted. sources[] comes from web_search_result items inside web_search_tool_result blocks: urlurl, titletitle, and publishedAtpage_age. Snippets live separately as URL-keyed cited_text entries in a text block's citations[]; the provider joins them, leaving snippet absent when no excerpt exists.

Results are deduplicated by URL because one request may surface the same page across searches. DeepSeek exposes maxUses, not a result-count knob, so the seam enforces maxResults by truncating sources[] and setting truncated.

Provider failures become WEB_PROVIDER_ERROR; caller cancellation becomes WEB_ABORTED. HTTP redirects are rejected before the Location target is contacted and surface as WEB_PROVIDER_ERROR.

Request logging

Immediately before dispatch, a search running under an initiating Agent appends the log-only web/deepseek-search-llm-request session event. It contains the resolved endpoint, API version, and exact secret-free JSON body sent to DeepSeek; headers and credentials are excluded. Credential failures and cancellations before dispatch create no event, while later HTTP or response failures leave the attempted request durable. Direct programmatic provider calls outside an Agent have no initiating session to log.

Model Experience

Auxiliary DeepSeek search request

What the model sees

A separate DeepSeek model receives exactly Perform a web search for the query: <query> as its user text and one native web_search server-tool definition. This request is not part of the conversation model's context.

Token effect

Separate provider input and output tokens are incurred for each search; maxTokens caps generated output and maxUses caps native search uses.

KV Cache effect

Independent of the conversation request cache. The auxiliary instruction and native tool definition can form a stable prefix, but each changed query or model route prevents reuse from its first difference.

Conversation tool result, indirectly

What the model sees

Through dsh-tool-web, the conversation model sees deduplicated URLs, titles, dates, and citation snippets from structured search blocks; provider prose is not trusted as an answer. This provider's exact failures include the actionable missing-credential message, DeepSeek search credential resolution failed: <error>, DeepSeek search aborted, DeepSeek search request failed: <error>, DeepSeek returned no web_search_tool_result blocks; the request may not have triggered native web search, and DeepSeek returned an unprocessable response body: <error>; HTTP failures preserve the provider message. The consumer owns the error wrapper.

Token effect

Zero direct conversation tokens from registration. Result tokens scale with returned sources and snippets, then the seam enforces the requested source bound.

KV Cache effect

Append-only; newly visible content follows the reusable request prefix and does not invalidate existing KV-cache entries.

Known Limitations and Deferred Work

  • One search costs a full Messages model turn — latency plus generated tokens, with up to maxUses server-side searches; DeepSeek exposes no dedicated retrieval endpoint.
  • Dynamic credential availability resolves inside the operation — the synchronous available() contract can establish that a resolver exists but cannot query an asynchronous credential store. A selected keyless provider therefore fails the search with WEB_PROVIDER_CREDENTIAL_MISSING; the stable web_search schema remains registered. Caller cancellation races this preflight locally, but cannot force an arbitrary credential backend itself to stop work.
  • Over-returned sources still cost tokens — with no result-count knob on the wire, maxResults is enforced only post-hoc by seam truncation.
  • Uncited results carry no snippet — a source gains one only when a text block citation (cited_text) matches its URL.

收录徽章

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/deepseek-ai/deepseek-harness/packages/web/web-search-deepseek)

把这段 markdown 粘贴到你的 GitHub README,链接回本插件详情页。徽章只声明已被本站收录,不代表安全认证。

返回插件目录
dsh-web-search-deepseek/packages/web/web-search-deepseek — DeepSeek Harness 插件 | deepseek-plugin.org