SuperAPI AI 工具集

perplexity-search

编程与开发

查看项目

更新于 10-15 19:57

技能介绍

用途:在 POSIX-shell 环境中调用 Perplexity API,完成搜索、带引用回答、深度研究和指定 URL 内容抓取。

主要能力:search.sh 返回带日期的排序结果与片段;ask.sh 生成带来源的回答;research.sh 在后台执行多步研究并支持 --resume 续接;fetch_url.sh 抓取指定页面内容。缓存按 TTL 控制复用,默认 900 秒,research.sh 为一天,头部会显示缓存年龄;--no-cache 强制实时请求。stdout 受 PPLX_PRINT_LIMIT 限制(默认 30 行),完整结果存于 cache/,可用 cache_grep.sh 或 find_latest.sh 检索。

使用方式:先运行 sh scripts/prepare_runtime.sh 创建可写副本并进入工作目录,再 cp config/.env.example config/.env 并填入 PERPLEXITY_API_KEY。示例:sh scripts/search.sh --query "..." --max-results 10;sh scripts/ask.sh --query "..." --preset fast;sh scripts/research.sh --query "..." --preset high --timeout 1800;sh scripts/fetch_url.sh --url "https://example.com/pricing"。

适用场景:需要可核查来源的检索、快速事实查询、多步背景研究以及读取特定网页内容。

限制:Search API 单次最多 5 个查询、20 条结果、20 个域名过滤,allowlist 与 denylist 不可混用;--recency 与显式日期互斥;anthropic/* 模型需 max_output_tokens(脚本填 8192);429 不计费并按 Retry-After 重试;Sonar Chat Completions 视为 legacy,技能使用 Agent API。价格、模型可用性等细节以官方资料为准,暂未提供更多说明。