perplexity-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePerplexity Search Skill
Perplexity Search Skill
A skill for executing real-time web searches and research using the Perplexity API.
一款基于Perplexity API执行实时网页搜索与调研的Skill。
Purpose
用途
This skill provides the following capabilities:
- perplexity_ask - Answer general questions (using sonar-pro model)
- perplexity_research - Deep research and comprehensive reports (using sonar-deep-research model)
- perplexity_reason - Advanced reasoning and analysis (using sonar-reasoning-pro model)
- perplexity_search - Retrieve web search results
本Skill具备以下功能:
- perplexity_ask - 解答通用问题(使用sonar-pro模型)
- perplexity_research - 深度调研与综合报告(使用sonar-deep-research模型)
- perplexity_reason - 高级推理与分析(使用sonar-reasoning-pro模型)
- perplexity_search - 检索网页搜索结果
When to Use
使用场景
Use this skill in the following situations:
- User needs up-to-date information
- Received a question requiring web search
- Asked to perform deep research or investigation
- Complex analysis or reasoning is required
- Keywords like "look up", "search for", "latest..." are included
在以下场景中可使用本Skill:
- 用户需要最新信息
- 收到需要网页搜索的问题
- 被要求进行深度调研或调查
- 需要复杂分析或推理
- 包含“查找”“搜索”“最新……”等关键词
Prerequisites
前置条件
- environment variable must be set
PERPLEXITY_API_KEY - Internet connection must be available
- 必须设置环境变量
PERPLEXITY_API_KEY - 需具备互联网连接
Usage
使用方法
Basic Usage
基础用法
Use the script to call the API.
scripts/perplexity_api.pybash
undefined使用脚本调用API。
scripts/perplexity_api.pybash
undefinedGeneral questions (ask)
General questions (ask)
python3 scripts/perplexity_api.py ask "your question"
python3 scripts/perplexity_api.py ask "your question"
Deep research (research)
Deep research (research)
python3 scripts/perplexity_api.py research "research topic"
python3 scripts/perplexity_api.py research "research topic"
Advanced reasoning (reason)
Advanced reasoning (reason)
python3 scripts/perplexity_api.py reason "reasoning task"
python3 scripts/perplexity_api.py reason "reasoning task"
Web search (search)
Web search (search)
python3 scripts/perplexity_api.py search "search query" [--max-results 10] [--country JP]
undefinedpython3 scripts/perplexity_api.py search "search query" [--max-results 10] [--country JP]
undefinedCommand Options
命令选项
ask / research / reason
ask / research / reason
- First argument: question, research topic, or reasoning task
- : Remove
--strip-thinkingtags to save context tokens (research/reason only)<think>...</think>
- 第一个参数:问题、调研主题或推理任务
- :移除
--strip-thinking标签以节省上下文令牌(仅适用于research/reason)<think>...</think>
search
search
- First argument: search query
- : Maximum number of results to return (1-20, default: 10)
--max-results - : Maximum tokens per page (256-2048, default: 1024)
--max-tokens-per-page - : ISO code for regional results (e.g., JP, US, GB)
--country
- 第一个参数:搜索查询词
- :返回结果的最大数量(1-20,默认值:10)
--max-results - :每页最大令牌数(256-2048,默认值:1024)
--max-tokens-per-page - :用于获取区域结果的ISO代码(例如:JP, US, GB)
--country
Workflow
工作流程
Standard Search Flow
标准搜索流程
-
Analyze the user's question and select the appropriate tool
- Simple questions →
ask - Deep research →
research - Complex analysis →
reason - Information gathering →
search
- Simple questions →
-
Execute the script to call the API
-
Present results to the user, citing sources when available
-
分析用户问题并选择合适的工具
- 简单问题 →
ask - 深度调研 →
research - 复杂分析 →
reason - 信息收集 →
search
- 简单问题 →
-
执行脚本调用API
-
向用户展示结果,若有来源则注明
Tool Selection Guidelines
工具选择指南
| Use Case | Tool | Description |
|---|---|---|
| Current weather, news | ask | When quick answers are needed |
| Technical topic research | research | When comprehensive analysis is needed |
| Complex problem analysis | reason | When logical reasoning is needed |
| Collecting sources | search | When URLs or snippets are needed |
| 使用场景 | 工具 | 说明 |
|---|---|---|
| 当前天气、新闻 | ask | 需要快速解答时 |
| 技术主题调研 | research | 需要综合分析时 |
| 复杂问题分析 | reason | 需要逻辑推理时 |
| 收集来源 | search | 需要URL或片段时 |
API Details
API详情
For detailed API specifications, see .
references/api_reference.md如需详细的API规范,请查看。
references/api_reference.mdTroubleshooting
故障排除
- API Key Error: Verify the environment variable
PERPLEXITY_API_KEY - Timeout: Increase (default: 300000ms)
PERPLEXITY_TIMEOUT_MS - Proxy Issues: Set or
PERPLEXITY_PROXYHTTPS_PROXY
- API密钥错误:验证环境变量是否正确设置
PERPLEXITY_API_KEY - 超时:增大(默认值:300000ms)
PERPLEXITY_TIMEOUT_MS - 代理问题:设置或
PERPLEXITY_PROXYHTTPS_PROXY