SuperAPI AI 工具集

xai-search

编程与开发

查看项目

更新于 10-16 03:10

技能介绍

用途:调用 xAI 的 Grok API,借助其代理式搜索(agentic search)工具实时检索 X/Twitter 和网页,回答时事、观点与事实类问题。

主要能力:支持 Grok 的 web_search 与 x_search 工具,可单独使用或组合使用;模型可选 grok-3-fast(快速搜索)与 grok-4-1-fast(推理,适合复杂查询)。模型可在需要时发起多次搜索调用。

X 搜索过滤:allowed_x_handles / excluded_x_handles 限定或排除账号;from_date / to_date 指定日期范围(ISO8601);enable_image_understanding、enable_video_understanding 分析帖内图文视频。网页搜索过滤:allowed_domains / excluded_domains 限定站点,enable_image_understanding 分析页面图片。

使用方式:需设置环境变量 XAI_API_KEY;Python 3 并安装 xai-sdk:pip install xai-sdk。可用 curl 直接请求 https://api.x.ai/v1/chat/completions,在 tools 中声明 web_search 或 x_search。也可使用 scripts/ 目录下的 xai-search.py,例如:python ~/.clawdbot/skills/xai-search/scripts/xai-search.py web "latest news about AI"、python ~/.clawdbot/skills/xai-search/scripts/xai-search.py x "what are people saying about Clawdbot"、python ~/.clawdbot/skills/xai-search/scripts/xai-search.py both "current events today"。

适用场景:突发新闻用 X 搜索;事实或研究类用网页搜索或两者兼用;情绪与观点用 X 搜索。

限制:费用、配额、速率限制、可用平台与完整参数细节暂未提供。文档:https://docs.x.ai/docs/