CyberCaius asked on Discord #help (10-30) for Volcengine's Doubao search
under Settings › Models › Search APIs, or a custom API address. Volcengine's
Doubao Search Custom (豆包搜索 Custom版, once 联网搜索 / 融合信息搜索,
docs.volcengine.com/docs/networked-search/networked-search, the same page
as volcengine.com/docs/87772/2272953) can now be added with its API key:
- provider.SearchVendors: volcengine, "Doubao Search (Volcengine)", at
https://open.feedcoopapi.com, keys at
console.volcengine.com/search-infinity/api-key, after DeepSeek. The GUI
takes its vendors from SearchVendors, so it shows in the Search API
picker with its Get a key link and base URL field; no GUI file changes.
- askSearchAPI: POST /search_api/web_search, Bearer key (the default, as
the docs and volcengine/mcp-server's askecho_search_infinity send it),
body {Query, SearchType: "web", Count: searchHits, Filter: {NeedUrl:
true}}. The query is cut to the 100 characters the docs allow. NeedUrl
leaves out its 火山如意 cards, which have no URL to cite.
- readVolcSearch reads Result.WebResults: Summary as the page's text (the
docs recommend it for models; Content is the whole page, Snippet
~200 chars "only for list display"), Snippet when there is no Summary,
PublishTime as the page's age, a 1970-01-01 time (its image example's
stand-in) as none, and a result with no Url left out.
- volcSearchError: its errors are in ResponseMetadata.Error, a code the
docs list, and the docs don't say the HTTP status, so the code decides:
10401/10403/10409 rest the key as turned away (403), 10406/10408/
10410/10412 (free searches spent with none paid, no plan, plan spent)
as out of credit (402), 700429 as rate limited (429). Any other code is
a plain error, a 200 carrying one included. The key is masked in the
error as for every vendor.
- A custom address: every search API already takes a base URL (#1580,
the field under the key in Settings, url= in the CLI), so an endpoint
that answers as Tavily, SearXNG, Brave, Exa, Firecrawl, You.com,
DeepSeek or now Doubao Search does can be set there. There is no common
format across the vendors (each has its own path, body and reply), so
no separate "custom" vendor was added.
- 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 and
refusal paragraph.
The test's reply is the docs' own web-search response example, byte for
byte (testdata/volcengine_web_search.json); its error replies are the
docs' error example with its "// 该字段为错误码" note taken out (not JSON).
Not tried against the real API: no Volcengine search key in this run.
Run (worktree on origin/main c941e0877, then rebased on d31710c71):
- TestVolcengineSearchAPI (new): red on the old code (no such vendor).
Broken by hand six ways, each red with its own message: Summary not read
(Snippet's text), volcSearchError not called (200 10403 read as "no
Result in it"), query not cut (150 characters went), NeedUrl dropped
(body {"Filter":{}}), 1970 age kept, 10412 not mapped (plain error, not
a refusal). Restored: ok.
- go test -run Search ./internal/gateway/, go test ./internal/provider/
./internal/cli/: ok, before and after the rebase.
- gofmt -l internal: nothing. go vet -tags nogui ./... on darwin,
GOOS=linux, GOOS=windows: ok.
- Not run before the push: the full go test ./... . mote had three other
sessions' full suites running at load 140-230; it runs after the push
and its result goes on the report.