智能体
developers.cloudflare.com ·
@Cloudflare Developers
Cloudflare 推出 Web Search API(beta):为 AI Agent 提供联网检索与实时信息 grounding
Cloudflare 在开发者 changelog 中宣布 Web Search API 进入 beta,让 AI Agent 和应用可联网搜索、用实时信息 grounding 回答,而非猜测 URL 或受模型训练截止时间限制。首发可选 Ceramic.ai、Exa、Linkup 三家搜索提供商,均支持通过 Cloudflare 请求的 Zero Data Retention,并承诺遵守 Cloudflare verified bot 抓取标准。该 API 经由 AI Gateway 运行,搜索请求会出现在 gateway 日志中,按各提供商 list API 价格计入 AI Gateway credits、无额外加价,也支持自带 provider API key。文档给出 REST 调用与 Worker 中 env.AI.websearch 两种用法示例。
AI推荐理由 Cloudflare 官方开发者 changelog 首发,信息密度高且可验证:Web Search API 进入 beta,通过 AI Gateway 调用,首发支持 Ceramic.ai、Exa、Linkup 三家搜索提供商,均支持 Zero Data Retention 并承诺遵守 Cloudflare verified bot 抓取标准;按各提供商 list API 价格计费、无加价,也支持自带 provider key,并给出 REST 与 Worker AI binding 两种调用示例。局限是仍为 beta,未提供延迟、准确率或成本对比等实测数据。
78
正文
[Web Search API](https://developers.cloudflare.com/web-search/) is now available in beta. Web Search API lets your AI agents and applications search the Internet and ground their responses in live information, instead of guessing URLs or relying on a model's training cutoff.
At launch, you can choose between three search providers: [Ceramic.ai, Exa, and Linkup](https://developers.cloudflare.com/web-search/providers/). All three support Zero Data Retention for requests made through Cloudflare, and all have committed to Cloudflare's [verified bot](https://developers.cloudflare.com/bots/concepts/bot/verified-bots/) crawling standards.
Web Search API runs through [AI Gateway](https://developers.cloudflare.com/ai-gateway/), so search requests appear in your gateway logs and are billed to your AI Gateway credits at each provider's list API price, with no additional markup. You can also bring your own provider API key.
Call Web Search API with the REST API:
```
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/websearch/ \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"query": "What are some fun things to do in Salt Lake City as fall approaches?",
"provider": "ceramic",
"limit": 5,
"options": { "gateway": { "id": "default" } }
}'
```
Or from a Worker with the AI binding:
```
const response = await env.AI.websearch({
gatewayId: "default",
query: "What are some fun things to do in Salt Lake City as fall approaches?",
provider: "exa",
limit: 5,
});
const results = await response.json();
```
To get started, refer to [How to use Web Search API](https://developers.cloudflare.com/web-search/how-to-use/).
来源报道 · 1 篇 · 以下链接均前往原始媒体
Cloudflare Developers
Cloudflare 推出 Web Search API(beta):为 AI Agent 提供联网检索与实时信息 grounding
10-02 · 原文发布