description: "The DeepSeek-backed search provider for ctx.web: how deployments mount native DeepSeek web search through the Anthropic-compatible Messages API, with per-search credential resolution."
English | 中文
With dsh-web-search-deepseek, the harness searches the web through DeepSeek's native search using an existing DEEPSEEK_API_KEY. Choose it when a deployment wants DeepSeek native search and accepts that one search costs a full model turn in latency and tokens, because DeepSeek exposes no dedicated search endpoint. Results come from the structured search blocks DeepSeek returns, never from scraping text out of a reply. A missing credential fails the call with a structured error; a response without a search-result block fails loudly rather than degrading. The model-facing web_search tool lives in dsh-tool-web.
Mount the provider in a composition that already loads the web service; it registers as the deepseek-official search provider, so ctx.web.search() resolves it automatically when it is the only usable search backend — or pin it with searchProvider: deepseek-official.
Choose this backend when a deployment wants DeepSeek's native server-side web search and already holds a DEEPSEEK_API_KEY — the provider reuses that credential reference. One search is heavier than a dedicated retrieval endpoint: DeepSeek runs the search inside a full model turn, so expect one Messages call's latency and generated tokens per search, with up to maxUses server-side searches per request. Avoid it when per-search cost or latency dominates.
Load the web service and the provider; the key resolves from ctx.credentials when that service is mounted, otherwise from the process environment. The auxiliary search call has its own endpoint setting and uses the Anthropic-compatible base https://api.deepseek.com/anthropic/v1, with /messages appended. It reads $DEEPSEEK_SEARCH_BASE_URL, independently of the conversation adapter’s $DEEPSEEK_BASE_URL and protocol.
- name: '@deepseek-ai/dsh-web'
- name: '@deepseek-ai/dsh-web-search-deepseek'
config:
apiKeyEnv: DEEPSEEK_API_KEY
baseURL: https://gateway.internal/anthropic/v1
| Field | Default | Meaning |
|---|---|---|
apiKey |
omitted | Literal DeepSeek API key; prefer apiKeyEnv so no secret enters configuration. A non-empty literal wins |
apiKeyEnv |
DEEPSEEK_API_KEY |
Credential reference resolved for each search through ctx.credentials, or from the process environment when that service is absent. A missing value fails the call as WEB_PROVIDER_CREDENTIAL_MISSING |
baseURL |
https://api.deepseek.com/anthropic/v1 |
Anthropic-compatible endpoint base; /messages is appended. Falls back to $DEEPSEEK_SEARCH_BASE_URL; an unparseable value makes the provider unavailable |
model |
deepseek-v4-flash |
Anthropic-format model name |
apiVersion |
2023-06-01 |
anthropic-version header value |
maxTokens |
4096 |
Positive-integer upper bound on generated tokens for the Messages request |
maxUses |
5 |
Positive-integer maximum web_search server-tool uses per request |
The generated configuration catalog is the exhaustive source for every accepted field and its JSDoc. The entry above is the base layer of the provider's 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.
content is always omitted: DeepSeek's provider prose is not trusted as an answer. sources[] comes from web_search_result items inside web_search_tool_result blocks — url and title directly, and publishedAt from page_age — with snippets joined from URL-keyed cited_text entries where an excerpt exists. Results are deduplicated by URL, and because DeepSeek exposes no result-count knob, the service enforces maxResults by truncating and flagging.
A search running under an initiating agent appends the log-only web/deepseek-search-llm-request session event immediately before dispatch. It carries the resolved endpoint, API version, and the 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.
Failures throw WebError with a machine-routable code: a missing credential is WEB_PROVIDER_CREDENTIAL_MISSING, caller cancellation is WEB_ABORTED, and provider or transport failures — including a response with no web_search_tool_result block — are WEB_PROVIDER_ERROR. HTTP redirects are rejected before the Location target is contacted. Every failure after dispatch names the resolved search endpoint and explains that search endpoint configuration is separate from chat. If the endpoint is unintended, the message tells the conversation model to guide the user to the Endpoint field under Settings > Plugins > Plugin configuration > Web search and save the change. When that page is unavailable, it names DEEPSEEK_SEARCH_BASE_URL and web-search-deepseek.baseURL as deployment configuration alternatives. The model must not choose or change the endpoint. The model-facing web_search tool surfaces this text under its own error wrapper.
Read these pages when the package-level contract is not enough. They move from the shared vocabulary to the service, the model-facing tools, and the design rationale.
web_search tool that renders this provider's sources.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.
Separate provider input and output tokens are incurred for each search; maxTokens caps generated output and maxUses caps native search uses.
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.
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>, and DeepSeek search aborted. Request, HTTP, native-search, and response-body failures append the resolved endpoint and the conditional configuration instruction described above. The consumer owns the error wrapper.
Zero direct conversation tokens from registration. Result tokens scale with returned sources and snippets, then the service enforces the requested source bound.
Append-only; newly visible content follows the reusable request prefix and does not invalidate existing KV-cache entries.
These limits define when the provider is expensive or incomplete. They are current package constraints.
maxUses server-side searches; DeepSeek exposes no dedicated retrieval endpoint.WEB_PROVIDER_CREDENTIAL_MISSING; the stable web_search schema stays registered.maxResults is enforced only post-hoc by service truncation.snippet — a source gains one only when a text-block citation (cited_text) matches its URL.