DeepSeek's own Search API (api-docs.deepseek.com/guides/search) can now be
added as a search API, with a DeepSeek API key:
- provider.SearchVendors: deepseek, at https://api.deepseek.com, keys at
platform.deepseek.com/api_keys, offered after You.com.
- askSearchAPI: POST /v1/tools/search, Bearer key (the default), body
{query, count: searchHits}. The query is cut to the 128 characters the
docs allow (a longer one is a 400); need_content stays false.
- readSearchAPI reads its summary (the docs' text "for a model",
~600-800 chars) as the page's text, since content is empty without
need_content; its snippet stands in when there is no summary, and its
date (RFC 3339 or null) is the page's age. Other vendors' fields are
read as before; summary and snippet are only fallbacks after content.
- 402 (no balance) and 429 (5 QPS per account) already rest a key as out
of credit and rate limited (searchRestFor); the test pins it for
deepseek.
- Siblings: CLI usage (main.go, search_cli.go's api list and empty-state
hint), README.md, README.zh-CN.md, gateway-routing.md's path list. The
GUI takes its vendors from SearchVendors (no vendor list in app.js or
i18n), so no GUI file changes.
Not tried against the real DeepSeek API (no key in this run); the fake is
built from the docs' response shape, with null site_name/date and empty
summary/content. Note DeepSeek bills direct API calls ($0.75 per 1,000
non-empty searches).
Run (worktree on origin/main bad4508c4 + this, the Factory and the Qoder
mover commits; machine load 130-345):
- TestDeepSeekSearchAPI (new) passes. Broken by hand five ways, each red
with its own message: summary not read (Text "Download Go."), query not
cut ("a long query went as 200 characters"), date not read (Age ""),
path /search instead of /v1/tools/search, snippet not read (second
page's Text ""). Restored: ok.
- gofmt -l internal cmd: nothing.
- go vet -tags nogui ./... on darwin, GOOS=linux, GOOS=windows: all ok.
- set -o pipefail; go test -tags nogui -timeout 45m ./... under a scratch
HOME: 65 packages ok (gateway 2654.9s, provider 930.5s, cli 533.2s);
internal/agent timed out at 45m (2704s, TestReverseProxyIsStillMagpie/
nginx running). That is #2723, untouched by these commits; rerun alone
with -timeout 90m: ok 3565.0s. Recorded on #2723.
After rebasing onto origin/main 89521b03d (13 new commits, none in the
search or mover files): gofmt -l . empty; go vet -tags nogui ./... ok on
darwin, linux, windows; go test -run 'Search|Mover|Moved|Migrat|Plugin'
./internal/gateway/ ./internal/provider/ ok (173.4s, 89.8s); go test
./internal/cli/ ok (286.5s). The full suite was not rerun at the rebased
head.