--- name: tavily-search description: > 使用 Tavily AI 搜索获取高质量的搜索结果,特别适合深度研究和技术查询。 支持中文和英文搜索,返回 AI 生成的答案摘要和来源链接。 --- # Tavily Search Skill ## Description 使用 Tavily AI 搜索获取高质量的搜索结果,特别适合深度研究和技术查询。 ## Activation 当用户需要以下类型的信息时,使用此 skill: - 最新资讯、新闻查询 - 技术文档、教程搜索 - 研究性内容、深度分析 - 需要引用来源的信息 - 复杂的查询问题 关键词触发: - "搜索一下..." - "查一下..." - "帮我找..." - "有什么最新..." - "研究一下..." ## Usage ### 命令行工具 ```bash # 使用系统安装的命令 tavily-search "<查询内容>" [结果数量] [basic|advanced] # 使用 skill 脚本 python3 scripts/tavily_search.py "<查询内容>" [结果数量] [basic|advanced] ``` ### Python 调用 ```python import sys sys.path.insert(0, 'scripts') from tavily_search import search, format_results # 执行搜索 result = search("Python async tutorial", max_results=5, search_depth="basic") # 获取格式化输出 output = format_results(result) print(output) # 或者直接访问结果数据 answer = result.get('answer', '') sources = result.get('results', []) for item in sources: print(f"Title: {item['title']}") print(f"URL: {item['url']}") ``` ## Configuration - API Key: 已配置在 `/etc/profile.d/tavily.sh` - 环境变量: `TAVILY_API_KEY` ## Output Format 工具返回格式化的搜索结果,包含: - AI 生成的答案摘要 - 来源链接列表(带可信度分数) - 内容摘要 ## Notes - 搜索会自动走 sing-box 代理(西雅图节点) - 免费额度:1000 次/月 - 支持中文和英文查询 - advanced 模式消耗更多额度但结果更详细 ## Preferences - **X/Twitter 搜索**: 搜索 X (Twitter) 内容时优先使用 Tavily,因为 X 直接访问需要登录,Nitter 等第三方服务不稳定