Back to Chatgpt On Wechat

web_search - Web Search

docs/en/tools/web-search.mdx

2.0.92.2 KB
Original Source

Search the internet for real-time information, news, research, and more. Supports four backends — Bocha, Baidu Qianfan, Zhipu, and LinkAI — and works once any one of them is configured.

<Tip> It is recommended to configure providers and routing strategy visually from the "Model Management → Search" panel in the [Web Console](/channels/web), without manually editing the configuration file. </Tip>

Providers

ProviderCredentialApply
Bochatools.web_search.bocha_api_keyBocha Open Platform
Baidu QianfanReuses qianfan_api_keyQianfan Console
ZhipuReuses zhipu_ai_api_keyZhipu Open Platform
LinkAIReuses linkai_api_keyLinkAI Console

Except for Bocha which requires a dedicated bocha_api_key, the other three reuse the corresponding model's API key — configuring the model automatically grants search capability.

Routing Strategy

json
{
  "tools": {
    "web_search": {
      "strategy": "auto",
      "provider": ""
    }
  }
}
  • auto (default): the Agent intelligently picks among configured providers and may call multiple providers in a single task to gather more comprehensive results; when none is specified, falls back through bocha → qianfan → zhipu → linkai.
  • fixed: always use the provider specified in provider; falls back to the auto order if that provider's credentials are missing.

Tool Parameters

ParameterTypeRequiredDescription
querystringYesSearch keywords
countintegerNoNumber of results (1–50, default 10)
freshnessstringNoTime range: noLimit (default), oneDay, oneWeek, oneMonth, oneYear, or date range like 2025-01-01..2025-02-01
summarybooleanNoWhether to return page summaries (default false)
providerstringNoAvailable when multiple providers are configured under the auto strategy; used to switch provider for a single call
<Note> If none of the four credentials are configured, this tool is not registered with the Agent. </Note>