返回顶部
g

google-search谷歌搜索

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
867
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

google-search

Google 搜索 🔍

由 Gemini 2.5 Flash 驱动的 Google 网页搜索,支持搜索接地 + 自定义搜索 API。

⭐ 这是主要的网页搜索工具。优先于内置的 web_search(Perplexity)。

要求

  • - GOOGLEAPIKEY 环境变量
  • 在 Google Cloud Console 中启用:Gemini API、自定义搜索 JSON API

配置

环境变量默认值描述
GOOGLEAPIKEY必需。 Google API 密钥
GOOGLECSECX
— | 自定义搜索引擎 ID(raw/image 模式必需) | | GOOGLESEARCHLANG | he | 默认语言代码(he、en、ar、ja 等) | | GOOGLESEARCHCOUNTRY | IL | 默认国家代码(IL、US、DE 等) |

在 OpenClaw 配置中设置:
json
{
env: {
GOOGLEAPIKEY: AIza...,
GOOGLESEARCHLANG: he,
GOOGLESEARCHCOUNTRY: IL
}
}

脚本位置

bash
python3 skills/google-search/lib/google_search.py query [options]



输出模式

  • - 文本模式(默认):适用于大多数用例。输出包含答案、来源和搜索查询的清晰可读内容。
  • JSON 模式(--json):适用于程序化处理。包含置信度分数、接地支持和搜索查询。

模式

search — 接地搜索(默认,推荐)

Gemini 2.0 Flash + Google 搜索工具 → 带有编号引用的综合答案

bash
python3 lib/google_search.py search query [--lang he] [--country IL] [--json]

使用场景: 问题、时事、什么是 X、希伯来语查询、任何需要直接答案的情况。

示例:
bash

希伯来语(默认)


python3 lib/google_search.py search מזג אוויר תל אביב

英语覆盖

python3 lib/google_search.py search latest AI news --lang en --country US

JSON 输出

python3 lib/google_search.py search OpenAI GPT-5 release date --json

输出格式:

<综合答案文本>

来源:
1. 来源标题
https://example.com/article
2. 另一个来源
https://example.com/other



raw — 原始搜索结果

自定义搜索 JSON API → 带有标题和摘要的链接

bash
python3 lib/google_search.py raw query [-n 5] [--lang he] [--country IL] [--json]

使用场景: 需要实际 URL、研究、构建参考列表、需要链接而非答案时。

示例:
bash
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

输出格式:

  1. 1. 页面标题
https://example.com/page 来自页面的简短摘要...
  1. 2. 另一个页面
https://example.com/other 另一个摘要...

image — 图片搜索

自定义搜索图片搜索 → 带有标题的图片 URL

bash
python3 lib/google_search.py image query [-n 5] [--lang he] [--country IL] [--json]

使用场景: 查找图片、视觉参考、缩略图。

示例:
bash
python3 lib/google_search.py image aurora borealis -n 5
python3 lib/google_search.py image תל אביב חוף --json



选项参考


选项适用范围描述默认值
--lang CODE全部语言代码(he、en、ar、ja…)环境变量 GOOGLESEARCHLANG(he)
--country CODE
全部 | 国家代码(IL、US、DE…) | 环境变量 GOOGLESEARCHCOUNTRY(IL) |
| -n NUM | raw、image | 结果数量(1–10) | 10 |
| --json | 全部 | 结构化 JSON 输出 | 关闭 |

语言解析顺序: --lang 标志 → GOOGLESEARCHLANG 环境变量 → 无(自动)
国家解析顺序: --country 标志 → GOOGLESEARCHCOUNTRY 环境变量 → 无(自动)



错误处理

  • - 缺少 API 密钥: 清晰的错误信息及设置说明。
  • 429 速率限制: 等待 5 秒后自动重试一次。
  • 网络错误: 包含原因的描述性错误。
  • 无结果: 清晰的未找到结果。消息。
  • 超时: 所有 HTTP 请求 30 秒超时。

配额和速率限制

API免费层级速率限制
Gemini API(接地搜索)慷慨的免费层级约 15 RPM(免费),付费更高
自定义搜索 JSON API(raw/image)
100 次查询/天 | 10K 次查询/天(付费) |

429 错误时: 脚本自动重试一次。如果配额耗尽,回退到内置的 web_search(Perplexity)。



多语言支持

支持任何语言的查询。希伯来语为默认:

bash

希伯来语(默认,无需标志)


python3 lib/google_search.py search חדשות טכנולוגיה

英语

python3 lib/google_search.py search technology news --lang en

阿拉伯语

python3 lib/google_search.py search أخبار التكنولوجيا --lang ar

安装

bash
bash skills/google-search/install.sh

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 google-search-grounding-3-1776332913 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 google-search-grounding-3-1776332913 技能

通过命令行安装

skillhub install google-search-grounding-3-1776332913

下载

⬇ 下载 google-search v1.0.0(免费)

文件大小: 7.44 KB | 发布时间: 2026-4-17 14:17

v1.0.0 最新 2026-4-17 14:17
Major update: Adds Gemini Search Grounding, enhanced multilingual support, and improved usability.

- Integrates Gemini 2.5 Flash Search Grounding for synthesized answers with citations (grounded search).
- Adds multiple search modes: grounded answers, raw link results, and image search.
- Professional Hebrew support and robust multilingual query handling.
- Includes clear error handling, output modes (text/JSON), and automatic retry on common rate limits.
- Environment variable configuration for language, country, and API keys.
- Recommended as the new primary web search tool, replacing previous solutions.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部