Appearance
Perplexity(网络搜索提供商)
Perplexity 插件通过 Perplexity Search API 或经由 OpenRouter 的 Perplexity Sonar 提供网络搜索能力。
注意:本页介绍的是 Perplexity 提供商配置。关于 Perplexity 工具(Agent 如何使用它),请参阅 Perplexity 工具。
- 类型:网络搜索提供商(非模型提供商)
- 鉴权:
PERPLEXITY_API_KEY(直连)或OPENROUTER_API_KEY(经由 OpenRouter) - 配置路径:
plugins.entries.perplexity.config.webSearch.apiKey
快速开始
- 设置 API Key:
bash
openclaw configure --section web或直接设置:
bash
openclaw config set plugins.entries.perplexity.config.webSearch.apiKey "pplx-xxxxxxxxxxxx"- 配置完成后,Agent 在需要网络搜索时会自动使用 Perplexity。
搜索模式
插件根据 API Key 前缀自动选择传输方式:
| Key 前缀 | 传输方式 | 功能特点 |
|---|---|---|
pplx- | 原生 Perplexity Search API | 结构化结果、域名/语言/日期过滤 |
sk-or- | OpenRouter(Sonar) | AI 合成答案并附带引用 |
原生 API 过滤参数
使用原生 Perplexity API(pplx- Key)时,搜索支持以下过滤:
- Country:2 字母国家代码
- Language:ISO 639-1 语言代码
- Date range:day、week、month、year
- Domain filters:域名白名单/黑名单(最多 20 个)
- Content budget:
max_tokens、max_tokens_per_page
环境变量注意事项
如果 Gateway 以守护进程方式运行(launchd/systemd),请确保 PERPLEXITY_API_KEY 对该进程可见(例如,写入 ~/.openclaw/.env 或通过 env.shellEnv 配置)。