智能搜索,溯源有据,希伯来语优先
简介
基于 Gemini 2.5 Flash 的 Google 搜索技能,支持智能摘要回答与引用、原始链接检索及图片搜索,默认优化希伯来语查询,是 Perplexity 内置搜索的首选替代方案。
原始描述
Google web search via Gemini Search Grounding (primary) and Custom Search JSON API (fallback). Use for: (1) Synthesized answers with citations (grounded search), (2) Raw link results with snippets, (3) Image search. Excellent Hebrew support. Preferred over built-in web_search (Perplexity).
通过你的 Agent 添加
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心功能
google-search 是一个双引擎搜索工具,集成 Gemini Search Grounding(主引擎)与 Google Custom Search JSON API(备用引擎),提供三种输出模式:
- search 模式(推荐):使用 Gemini 2.5 Flash 生成带编号引用的综合答案,适合问答、时事查询及希伯来语内容,输出包含置信度评分与溯源链接
- raw 模式:返回原始搜索结果的标题、链接与摘要片段,适用于研究、参考文献整理及需要实际 URL 的场景
- image 模式:专用图片搜索,返回图片 URL 与标题
显著优势
- 智能摘要与引用:Grounding 技术自动生成结构化答案,减少人工筛选结果的时间
- 希伯来语深度优化:默认语言设为希伯来语(
he),对希伯来语查询的语义理解优于通用搜索工具 - 双引擎冗余设计:Gemini API 与 Custom Search API 互补,配额耗尽时可自动降级
- 灵活输出格式:支持人类可读的文本输出与机器友好的 JSON 格式,便于集成工作流
- 健壮的错误处理:含 429 限流自动重试、30 秒超时保护、清晰的错误提示
局限性与注意事项
- API 配额限制:Custom Search JSON API 免费版仅 100 次/天,Gemini API 免费版约 15 RPM,高频场景需付费升级
- 配置复杂度:需同时配置
GOOGLE_API_KEY与GOOGLE_CSE_CX(用于 raw/image 模式),并在 Google Cloud Console 启用多项服务 - 地域默认值:默认国家码为以色列(IL),非希伯来语/以色列用户需显式覆盖
--country参数 - 环境依赖:需安装
google-genaiPython 包,不适用于纯离线环境
适用人群
- 需要带引用来源的智能搜索答案,而非原始链接列表的用户
- 希伯来语内容研究者或以色列地区用户
- 需要将搜索结果结构化集成到自动化工作流的开发者
- 对 Perplexity 内置搜索质量不满,寻求替代方案的用户
潜在风险
- API 密钥泄露:
GOOGLE_API_KEY需妥善保管,硬编码或日志泄露可能导致配额滥用 - 成本失控:Gemini Pro 与 Custom Search 付费层级若未设置预算警报,可能产生意外费用
- 结果偏差:Gemini Grounding 生成的摘要可能遗漏冷门观点或呈现过度自信的合成答案,关键决策仍需人工核验原始来源
- 服务可用性:Google API 服务条款变更或区域限制可能影响可用性
技能正文
name: google-search slug: google-search-grounding description: > Google web search via Gemini Search Grounding (primary) and Custom Search JSON API (fallback). Use for: (1) Synthesized answers with citations (grounded search), (2) Raw link results with snippets, (3) Image search. Excellent Hebrew support. Preferred over built-in web_search (Perplexity). version: 2.0.0 author: Leo 🦁 tags: [search, google, web, grounding, gemini, news, hebrew, images, citations] metadata: {"clawdbot":{"emoji":"🔍","requires":{"env":["GOOGLE_API_KEY"]},"primaryEnv":"GOOGLE_API_KEY","install":[{"id":"pip","kind":"pip","package":"google-genai","label":"Install dependencies (pip)"}]}} allowed-tools: [exec]
Google Search 🔍
Google web search powered by Gemini 2.5 Flash with Search Grounding + Custom Search API.
⭐ This is the PRIMARY web search tool. Prefer over built-in web_search (Perplexity).
Requirements
GOOGLE_API_KEYenvironment variable- Enable in Google Cloud Console: Gemini API, Custom Search JSON API
Configuration
| Env Variable | Default | Description |
|---|---|---|
GOOGLE_API_KEY |
— | Required. Google API key |
GOOGLE_CSE_CX |
— | Custom Search Engine ID (required for raw/image modes) |
GOOGLE_SEARCH_LANG |
he |
Default language code (he, en, ar, ja, etc.) |
GOOGLE_SEARCH_COUNTRY |
IL |
Default country code (IL, US, DE, etc.) |
Set in OpenClaw config:
{
"env": {
"GOOGLE_API_KEY": "AIza...",
"GOOGLE_SEARCH_LANG": "he",
"GOOGLE_SEARCH_COUNTRY": "IL"
}
}
Script Location
python3 skills/google-search/lib/google_search.py <mode> "query" [options]
Output Modes
- Text mode (default): Best for most use cases. Clean readable output with answer, sources, and search queries.
- JSON mode (
--json): For programmatic processing. Includes confidence scores, grounding supports, and search queries.
Modes
search — Grounded Search (Default, Recommended)
Gemini 2.0 Flash + Google Search tool → synthesized answer with numbered citations.
python3 lib/google_search.py search "query" [--lang he] [--country IL] [--json]
When to use: Questions, current events, "what is X", Hebrew queries, anything needing a direct answer.
Examples:
# Hebrew (default)
python3 lib/google_search.py search "מזג אוויר תל אביב"
# English override
python3 lib/google_search.py search "latest AI news" --lang en --country US
# JSON output
python3 lib/google_search.py search "OpenAI GPT-5 release date" --json
Output format:
<Synthesized answer text>
Sources:
1. Source Title
https://example.com/article
2. Another Source
https://example.com/other
raw — Raw Search Results
Custom Search JSON API → links with titles and snippets.
python3 lib/google_search.py raw "query" [-n 5] [--lang he] [--country IL] [--json]
When to use: Need actual URLs, research, building reference lists, when you want links not answers.
Examples:
python3 lib/google_search.py raw "python asyncio tutorial" -n 5
python3 lib/google_search.py raw "best restaurants tel aviv" --json
python3 lib/google_search.py raw "rust vs go performance" -n 3 --lang en
Output format:
1. Page Title
https://example.com/page
Brief snippet from the page...
2. Another Page
https://example.com/other
Another snippet...
image — Image Search
Custom Search image search → image URLs with titles.
python3 lib/google_search.py image "query" [-n 5] [--lang he] [--country IL] [--json]
When to use: Finding images, visual references, thumbnails.
Examples:
python3 lib/google_search.py image "aurora borealis" -n 5
python3 lib/google_search.py image "תל אביב חוף" --json
Options Reference
| Option | Applies To | Description | Default |
|---|---|---|---|
--lang CODE |
all | Language code (he, en, ar, ja…) | env GOOGLE_SEARCH_LANG (he) |
--country CODE |
all | Country code (IL, US, DE…) | env GOOGLE_SEARCH_COUNTRY (IL) |
-n NUM |
raw, image | Number of results (1–10) | 10 |
--json |
all | Structured JSON output | off |
Language resolution order: --lang flag → GOOGLE_SEARCH_LANG env → None (auto)
Country resolution order: --country flag → GOOGLE_SEARCH_COUNTRY env → None (auto)
Error Handling
- Missing API key: Clear error message with setup instructions.
- 429 Rate Limit: Automatic retry once after 5-second wait.
- Network errors: Descriptive error with cause.
- No results: Clean "No results found." message.
- Timeout: 30-second timeout on all HTTP requests.
Quota & Rate Limits
| API | Free Tier | Rate Limit |
|---|---|---|
| Gemini API (grounded search) | Generous free tier | ~15 RPM (free), higher on paid |
| Custom Search JSON API (raw/image) | 100 queries/day | 10K queries/day (paid) |
On 429 errors: Script retries once automatically. If quota exhausted, fall back to built-in web_search (Perplexity).
Multilingual Support
Works with queries in any language. Hebrew is the default:
# Hebrew (default, no flags needed)
python3 lib/google_search.py search "חדשות טכנולוגיה"
# English
python3 lib/google_search.py search "technology news" --lang en
# Arabic
python3 lib/google_search.py search "أخبار التكنولوجيا" --lang ar
Install
bash skills/google-search/install.sh
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。