Docs: update zh-CN translations and pipeline

What:
- update zh-CN glossary, TM, and translator prompt
- regenerate zh-CN docs and apply targeted fixes
- add zh-CN AGENTS pipeline guidance

Why:
- address terminology/spacing feedback from #6995

Tests:
- pnpm build && pnpm check && pnpm test
This commit is contained in:
Josh Palmer
2026-02-03 13:23:00 -08:00
parent 9f03791aa9
commit a3ec2d0734
228 changed files with 10651 additions and 10475 deletions
+54 -61
View File
@@ -2,11 +2,11 @@
read_when:
- 你想启用 web_search 或 web_fetch
- 你需要设置 Brave Search API 密钥
- 你想使用 Perplexity Sonar 进行网搜索
summary: 网页搜索 + 取工具(Brave Search API、Perplexity 直连/OpenRouter
title: 网页工具
- 你想使用 Perplexity Sonar 进行网搜索
summary: Web 搜索 + 取工具(Brave Search API、Perplexity 直连/OpenRouter
title: Web 工具
x-i18n:
generated_at: "2026-02-01T21:43:53Z"
generated_at: "2026-02-03T10:12:43Z"
model: claude-opus-4-5
provider: pi
source_hash: 760b706cc966cb421e370f10f8e76047f8ca9fe0a106d90c05d979976789465a
@@ -14,34 +14,32 @@ x-i18n:
workflow: 15
---
# 网页工具
# Web 工具
OpenClaw 内置两个轻量级网页工具:
OpenClaw 提供两个轻量级 Web 工具:
- `web_search` — 通过 Brave Search API(默认)或 Perplexity Sonar(直连或通过 OpenRouter)搜索网
- `web_fetch` — HTTP 取 + 可读内容提取(HTML → markdown/文本)。
- `web_search` — 通过 Brave Search API(默认)或 Perplexity Sonar(直连或通过 OpenRouter)搜索网
- `web_fetch` — HTTP 取 + 可读提取(HTML → markdown/文本)。
这些**不是**浏览器自动化。对于 JS 密集型网站或需要登录的场景,请使用
[浏览器工具](/tools/browser)。
这些**不是**浏览器自动化。对于 JS 密集型网站或需要登录的情况,请使用[浏览器工具](/tools/browser)。
## 工作原理
- `web_search` 调用你配置的提供商并返回结果。
- **Brave**(默认):返回结构化结果(标题、URL、摘要)。
- **Perplexity**:返回基于实时网搜索的 AI 综合答案及引用来源
- **Perplexity**:返回带有实时网搜索引用的 AI 综合答案。
- 结果按查询缓存 15 分钟(可配置)。
- `web_fetch` 执行普通 HTTP GET 并提取可读内容
HTML → markdown/文本)。它**不会**执行 JavaScript。
- `web_fetch` 执行普通 HTTP GET 并提取可读内容HTML → markdown/文本)。它**不**执行 JavaScript。
- `web_fetch` 默认启用(除非显式禁用)。
## 选择搜索提供商
| 提供商 | 优点 | 缺点 | API 密钥 |
| ----------------- | ------------------------------- | -------------------------------------- | -------------------------------------------- |
| **Brave**(默认) | 快速、结构化结果、免费额度 | 传统搜索结果 | `BRAVE_API_KEY` |
| **Perplexity** | AI 综合答案、引用来源、实时搜索 | 需要 Perplexity 或 OpenRouter 访问权限 | `OPENROUTER_API_KEY``PERPLEXITY_API_KEY` |
| 提供商 | 优点 | 缺点 | API 密钥 |
| ----------------- | ------------------------ | ---------------------------------- | -------------------------------------------- |
| **Brave**(默认) | 快速、结构化结果、免费 | 传统搜索结果 | `BRAVE_API_KEY` |
| **Perplexity** | AI 综合答案、引用、实时 | 需要 Perplexity 或 OpenRouter 访问 | `OPENROUTER_API_KEY``PERPLEXITY_API_KEY` |
有关特定提供商的详情,请参阅 [Brave Search 设置](/brave-search) 和 [Perplexity Sonar](/perplexity)。
参见 [Brave Search 设置](/brave-search) 和 [Perplexity Sonar](/perplexity) 了解提供商特定详情
在配置中设置提供商:
@@ -79,30 +77,25 @@ OpenClaw 内置两个轻量级网页工具:
## 获取 Brave API 密钥
1. 在 https://brave.com/search/api/ 创建 Brave Search API 账户
2. 在控制面板中,选择 **Data for Search** 计划(不是 "Data for AI")并生成 API 密钥。
3. 运行 `openclaw configure --section web` 将密钥存储配置中(推荐),或在环境中设置 `BRAVE_API_KEY`
2. 在控制面板中,选择 **Data for Search** 计划(不是"Data for AI")并生成 API 密钥。
3. 运行 `openclaw configure --section web` 将密钥存储配置中(推荐),或在环境中设置 `BRAVE_API_KEY`
Brave 提供免费额度和付费计划;查看 Brave API 门户了解
当前的限制和定价。
Brave 提供免费和付费计划;查看 Brave API 门户了解当前限制和定价。
### 密钥设置位置(推荐)
### 在哪里设置密钥(推荐)
**推荐:**运行 `openclaw configure --section web`。它将密钥存储在
`~/.openclaw/openclaw.json``tools.web.search.apiKey` 下。
**推荐:** 运行 `openclaw configure --section web`。它将密钥存储在 `~/.openclaw/openclaw.json``tools.web.search.apiKey` 下。
**环境变量替代方案:**在 Gateway网关进程环境中设置 `BRAVE_API_KEY`。对于 Gateway网关安装,将其放 `~/.openclaw/.env`(或你的
服务环境)。参见[环境变量](/help/faq#how-does-openclaw-load-environment-variables)。
**环境变量替代方案:** 在 Gateway 网关进程环境中设置 `BRAVE_API_KEY`。对于 Gateway 网关安装,将其放 `~/.openclaw/.env`(或你的服务环境)中。参见[环境变量](/help/faq#how-does-openclaw-load-environment-variables)。
## 使用 Perplexity(直连或通过 OpenRouter
Perplexity Sonar 模型内置网页搜索功能,并返回带有引用来源的 AI 综合
答案。你可以通过 OpenRouter 使用它们(无需信用卡——支持
加密货币/预付费)。
Perplexity Sonar 模型具有内置的网络搜索功能,并返回带有引用的 AI 综合答案。你可以通过 OpenRouter 使用它们(无需信用卡 - 支持加密货币/预付费)。
### 获取 OpenRouter API 密钥
1. 在 https://openrouter.ai/ 创建账户
2. 充值(支持加密货币、预付费或信用卡)
2. 添加额度(支持加密货币、预付费或信用卡)
3. 在账户设置中生成 API 密钥
### 设置 Perplexity 搜索
@@ -115,9 +108,9 @@ Perplexity Sonar 模型内置网页搜索功能,并返回带有引用来源的
enabled: true,
provider: "perplexity",
perplexity: {
// API 密钥(如果设置 OPENROUTER_API_KEY 或 PERPLEXITY_API_KEY 则可选)
// API 密钥(如果设置 OPENROUTER_API_KEY 或 PERPLEXITY_API_KEY 则可选)
apiKey: "sk-or-v1-...",
// 基础 URL(省略根据密钥自动选择默认值)
// 基础 URL如果省略根据密钥感知默认值)
baseUrl: "https://openrouter.ai/api/v1",
// 模型(默认为 perplexity/sonar-pro
model: "perplexity/sonar-pro",
@@ -128,7 +121,7 @@ Perplexity Sonar 模型内置网页搜索功能,并返回带有引用来源的
}
```
**环境变量替代方案:**在 Gateway网关环境中设置 `OPENROUTER_API_KEY``PERPLEXITY_API_KEY`。对于 Gateway网关安装,将其放 `~/.openclaw/.env`
**环境变量替代方案:** 在 Gateway 网关环境中设置 `OPENROUTER_API_KEY``PERPLEXITY_API_KEY`。对于 Gateway 网关安装,将其放 `~/.openclaw/.env`
如果未设置基础 URLOpenClaw 会根据 API 密钥来源选择默认值:
@@ -140,18 +133,18 @@ Perplexity Sonar 模型内置网页搜索功能,并返回带有引用来源的
| 模型 | 描述 | 最适合 |
| -------------------------------- | -------------------- | -------- |
| `perplexity/sonar` | 带网搜索的快速问答 | 快速查询 |
| `perplexity/sonar-pro`(默认) | 带网搜索的多步推理 | 复杂问题 |
| `perplexity/sonar` | 带网搜索的快速问答 | 快速查询 |
| `perplexity/sonar-pro`(默认) | 带网搜索的多步推理 | 复杂问题 |
| `perplexity/sonar-reasoning-pro` | 思维链分析 | 深度研究 |
## web_search
使用配置的提供商搜索网
使用配置的提供商搜索网
### 前提条件
### 要求
- `tools.web.search.enabled` 不能为 `false`(默认:启用)
- 你选择的提供商的 API 密钥:
- 所选提供商的 API 密钥:
- **Brave**`BRAVE_API_KEY``tools.web.search.apiKey`
- **Perplexity**`OPENROUTER_API_KEY``PERPLEXITY_API_KEY``tools.web.search.perplexity.apiKey`
@@ -163,7 +156,7 @@ Perplexity Sonar 模型内置网页搜索功能,并返回带有引用来源的
web: {
search: {
enabled: true,
apiKey: "BRAVE_API_KEY_HERE", // 如果设置 BRAVE_API_KEY 则可选
apiKey: "BRAVE_API_KEY_HERE", // 如果设置 BRAVE_API_KEY 则可选
maxResults: 5,
timeoutSeconds: 30,
cacheTtlMinutes: 15,
@@ -175,17 +168,17 @@ Perplexity Sonar 模型内置网页搜索功能,并返回带有引用来源的
### 工具参数
- `query`(必
- `count`110;默认从配置获取
- `country`(可选):用于区域特定结果的 2 字母国家代码(例如 "DE"、"US"、"ALL")。省略Brave 使用其默认区
- `search_lang`(可选):搜索结果的 ISO 语言代码(例如 "de"、"en"、"fr"
- `query`(必
- `count`110;默认来自配置
- `country`(可选):用于特定地区结果的 2 字母国家代码(例如"DE"、"US"、"ALL")。如果省略,Brave 选择其默认区。
- `search_lang`(可选):搜索结果的 ISO 语言代码(例如"de"、"en"、"fr"
- `ui_lang`(可选):UI 元素的 ISO 语言代码
- `freshness`(可选,仅限 Brave):按发现时间过滤(`pd``pw``pm``py``YYYY-MM-DDtoYYYY-MM-DD`
**示例:**
```javascript
// 德特定搜索
// 德特定搜索
await web_search({
query: "TV online schauen",
count: 10,
@@ -193,7 +186,7 @@ await web_search({
search_lang: "de",
});
// 法语搜索,使用法语 UI
// 带法语 UI 的法语搜索
await web_search({
query: "actualités",
country: "FR",
@@ -201,7 +194,7 @@ await web_search({
ui_lang: "fr",
});
// 最近结果(过去一周)
// 最近结果(过去一周)
await web_search({
query: "TMBG interview",
freshness: "pw",
@@ -210,9 +203,9 @@ await web_search({
## web_fetch
取 URL 并提取可读内容。
取 URL 并提取可读内容。
### 前提条件
### 要求
- `tools.web.fetch.enabled` 不能为 `false`(默认:启用)
- 可选的 Firecrawl 回退:设置 `tools.web.fetch.firecrawl.apiKey``FIRECRAWL_API_KEY`
@@ -233,7 +226,7 @@ await web_search({
readability: true,
firecrawl: {
enabled: true,
apiKey: "FIRECRAWL_API_KEY_HERE", // 如果设置 FIRECRAWL_API_KEY 则可选
apiKey: "FIRECRAWL_API_KEY_HERE", // 如果设置 FIRECRAWL_API_KEY 则可选
baseUrl: "https://api.firecrawl.dev",
onlyMainContent: true,
maxAgeMs: 86400000, // 毫秒(1 天)
@@ -247,18 +240,18 @@ await web_search({
### 工具参数
- `url`(必,仅限 http/https
- `url`(必,仅限 http/https
- `extractMode``markdown` | `text`
- `maxChars`(截断过长的页面)
- `maxChars`(截断页面)
说明
注意
- `web_fetch` 首先使用 Readability(主要内容提取),然后使用 Firecrawl(如果已配置)。如果两者都失败,工具返回错误。
- Firecrawl 请求使用机器人检测模式并默认缓存结果。
- `web_fetch` 默认发送类 Chrome 的 User-Agent 和 `Accept-Language`;如需覆盖请修改 `userAgent`
- `web_fetch` 阻止私有/内部主机名并重新检查重定向(通过 `maxRedirects` 限制)。
- `web_fetch` 是尽力提取;某些网站需要使用浏览器工具。
- 有关密钥设置和服务详情,请参阅 [Firecrawl](/tools/firecrawl)。
- 响应会被缓存(默认 15 分钟)以减少重复取。
- 如果你使用工具配置文件/允许列表,添加 `web_search`/`web_fetch``group:web`
- 如果缺少 Brave 密钥,`web_search` 返回一个简短的设置提示文档链接。
- Firecrawl 请求使用机器人规避模式并默认缓存结果。
- `web_fetch` 默认发送类 Chrome 的 User-Agent 和 `Accept-Language`;如需要可覆盖 `userAgent`
- `web_fetch` 阻止私有/内部主机名并重新检查重定向( `maxRedirects` 限制)。
- `web_fetch` 是尽力提取;某些网站需要浏览器工具。
- 参见 [Firecrawl](/tools/firecrawl) 了解密钥设置和服务详情
- 响应会被缓存(默认 15 分钟)以减少重复取。
- 如果你使用工具配置文件/允许列表,添加 `web_search`/`web_fetch``group:web`
- 如果缺少 Brave 密钥,`web_search` 返回一个简短的设置提示文档链接。