重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
tavily-web-search by alphaonedev/openclaw-graph
npx skills add https://github.com/alphaonedev/openclaw-graph --skill tavily-web-search此技能使 AI 代理能够使用 Tavily 执行网络搜索,Tavily 是一项针对 AI 工作流优化的服务。它能从搜索结果中综合答案、应用域名过滤器并控制搜索深度,以提供相关、简洁的信息,而不会使代理不堪重负。
当您需要实时网络数据时使用此技能,例如获取最新新闻、核实事实或收集研究资料。在标准搜索引擎返回信息过于冗长的情况下应用它,例如为用户查询综合答案、将结果过滤到特定域名(例如 .edu 站点)或限制深度以快速响应。对于内部数据访问或离线源足够的情况,请避免使用。
search_depth 参数指定(例如,0 表示浅层搜索,5 表示深度搜索)。include_domains 标志将搜索限制在特定域名,如 "example.com";示例:include_domains=["wikipedia.org"]。max_results(1-10)设置搜索深度以控制结果数量;值越高细节越多但成本也越高。query 字符串和用于身份验证的 api_key。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
始终通过环境变量 $TAVILY_API_KEY 使用 API 密钥进行初始化。对于基本搜索,构建一个查询对象并调用 API 端点。在循环中使用以进行迭代优化,例如根据初始结果优化查询。模式:设置身份验证,使用过滤器构建查询,执行搜索,然后解析并综合响应。对于代理工作流,将其作为子工具集成到多步骤流程中,确保在调用之间进行错误检查。
Tavily 使用 REST API 端点:https://api.tavily.com/search。身份验证需要在环境中设置 $TAVILY_API_KEY。
示例 CLI curl 命令:
curl -H "Content-Type: application/json" \
-H "X-Api-Key: $TAVILY_API_KEY" \
https://api.tavily.com/search -d '{"query": "latest AI news", "max_results": 3}'
用于 API 调用的 Python 代码片段:
import requests
api_key = os.environ.get('TAVILY_API_KEY')
response = requests.post('https://api.tavily.com/search', headers={'X-Api-Key': api_key}, json={'query': 'climate change effects', 'include_domains': ['nytimes.com']})
results = response.json()['results']
常用标志/参数:
query:字符串,必需;例如,"OpenAI updates"。max_results:整数(1-10);控制深度,例如,5 表示平衡的结果。include_domains:字符串数组;例如,["bbc.com", "cnn.com"] 用于新闻网站。exclude_domains:数组;例如,["socialmedia.com"] 以避免某些网站。要集成,首先从 Tavily 仪表板获取 API 密钥,并将其设置为 $TAVILY_API_KEY。在代码中,导入必要的库(例如 Python 中的 requests)并将 API 响应作为 JSON 处理。对于 OpenClaw 代理,通过在你的代理配置中引用 ID "tavily-web-search" 将此技能添加到你的工具集,例如:tools: ["tavily-web-search"]。YAML 中的配置格式示例:
tools:
- id: tavily-web-search
config:
api_key_env: TAVILY_API_KEY
default_params:
max_results: 3
确保你的代理在调用前检查密钥的可用性;如果缺失,则提示用户。在沙盒环境中测试集成以验证响应格式。
常见错误包括 401(无效 API 密钥导致未授权)、429(超出速率限制)和 400(无效参数导致错误请求)。处理方法:在解析前检查响应状态码;如果是 401,记录 "API 密钥错误:请设置 $TAVILY_API_KEY" 并在用户输入后重试。对于 429,实现指数退避(例如,等待 5 秒后重试)。事先验证输入,例如确保 query 不为空。代码中的错误检查示例:
if response.status_code == 401:
raise ValueError("Authentication failed; ensure $TAVILY_API_KEY is set")
elif response.status_code >= 400:
print(f"Error: {response.json().get('error')}")
include_domains=["reuters.com"] 和 max_results=2。然后,综合响应以提取关键事实,例如在代码中:synthesized_answer = summarize_results(results)。search_depth=3。解析结果以过滤日期或来源,然后在代理响应中使用:"Based on Tavily search, key trends include..."。每周安装次数
61
仓库
首次出现
2026年3月7日
安全审计
安装于
gemini-cli59
github-copilot59
codex59
amp59
cline59
kimi-cli59
This skill enables AI agents to perform web searches using Tavily, a service optimized for AI workflows. It synthesizes answers from search results, applies domain filters, and controls search depth to deliver relevant, concise information without overwhelming the agent.
Use this skill when you need real-time web data, such as fetching current news, verifying facts, or gathering research. Apply it in scenarios where standard search engines are too verbose, like synthesizing answers for user queries, filtering results to specific domains (e.g., .edu sites), or limiting depth for quick responses. Avoid it for internal data access or when offline sources suffice.
search_depth parameter (e.g., 0 for shallow, 5 for deep).include_domains flag; example: include_domains=["wikipedia.org"].max_results (1-10) to control result volume; higher values increase detail but raise costs.query string and api_key for authentication.Always initialize with an API key via environment variable $TAVILY_API_KEY. For basic searches, construct a query object and call the API endpoint. Use in loops for iterative refinement, e.g., refine queries based on initial results. Pattern: Set up auth, build query with filters, execute search, then parse and synthesize the response. For agent workflows, integrate as a subtool in multi-step processes, ensuring error checks between calls.
Tavily uses a REST API endpoint: https://api.tavily.com/search. Authentication requires setting $TAVILY_API_KEY in your environment.
Example CLI curl command:
curl -H "Content-Type: application/json" \
-H "X-Api-Key: $TAVILY_API_KEY" \
https://api.tavily.com/search -d '{"query": "latest AI news", "max_results": 3}'
Python code snippet for API call:
import requests
api_key = os.environ.get('TAVILY_API_KEY')
response = requests.post('https://api.tavily.com/search', headers={'X-Api-Key': api_key}, json={'query': 'climate change effects', 'include_domains': ['nytimes.com']})
results = response.json()['results']
Common flags/parameters:
query: String, required; e.g., "OpenAI updates".max_results: Integer (1-10); controls depth, e.g., 5 for balanced results.include_domains: Array of strings; e.g., ["bbc.com", "cnn.com"] for news sites.exclude_domains: Array; e.g., ["socialmedia.com"] to avoid certain sites.To integrate, first obtain a Tavily API key from their dashboard and set it as $TAVILY_API_KEY. In code, import necessary libraries (e.g., requests in Python) and handle the API response as JSON. For OpenClaw agents, add this skill to your toolset by referencing the ID "tavily-web-search" in your agent config, like: tools: ["tavily-web-search"]. Config format example in YAML:
tools:
- id: tavily-web-search
config:
api_key_env: TAVILY_API_KEY
default_params:
max_results: 3
Ensure your agent checks for key availability before calling; if missing, prompt the user. Test integrations in a sandbox environment to verify response formats.
Common errors include 401 (unauthorized) for invalid API keys, 429 (rate limit exceeded), and 400 (bad request for invalid parameters). To handle: Check response status code before parsing; if 401, log "API key error: Set $TAVILY_API_KEY" and retry after user input. For 429, implement exponential backoff (e.g., wait 5 seconds then retry). Validate inputs beforehand, e.g., ensure query is not empty. Example error check in code:
if response.status_code == 401:
raise ValueError("Authentication failed; ensure $TAVILY_API_KEY is set")
elif response.status_code >= 400:
print(f"Error: {response.json().get('error')}")
include_domains=["reuters.com"] and max_results=2. Then, synthesize the response to extract key facts, e.g., in code: synthesized_answer = summarize_results(results).search_depth=3. Parse results to filter for dates or sources, then use in an agent response: "Based on Tavily search, key trends include...".Weekly Installs
61
Repository
First Seen
Mar 7, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli59
github-copilot59
codex59
amp59
cline59
kimi-cli59
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
75,300 周安装
iOS隐私用户体验优化配置工具 - 提升iOS应用隐私合规与用户体验
1 周安装
iOS性能分析与优化工具 - 使用codex-config进行iOS应用性能剖析
1 周安装
iOS Now Playing MusicKit 技能 - 集成 Apple MusicKit 实现音乐播放控制
1 周安装
iOS CarPlay 现在播放控制技能 - 在 GitHub 上查看 derklinke/codex-config 项目
1 周安装
iOS网络迁移工具 - 代码库配置迁移助手,简化iOS项目网络层重构
1 周安装
iOS 网络诊断工具 - 网络协议分析、调试与性能优化 | derklinke/codex-config
1 周安装