← 返回 Skills 市场
jas0n1ee

gemini-smart-search

作者 jas0n1ee · GitHub ↗ · v0.1.1 · MIT-0
cross-platform ✓ 安全检测通过
240
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install gemini-smart-search
功能描述
Search the web using Gemini with Google Search grounding through a local script, with model routing and quota fallback across Gemini Flash-Lite / Flash varia...
使用说明 (SKILL.md)

Gemini Smart Search

Use this skill when Gemini should be the search backend, but gateway-level web_search config is too static or too disruptive to change.

Purpose

This skill is a script-backed search workflow, not a gateway tool override.

It exists to provide:

  • dynamic Gemini model selection
  • quota-aware fallback
  • a separate Gemini API key path if desired
  • structured JSON output
  • no gateway restart requirement for model changes

Modes

Model routing is split into two layers:

  • display chain: human-facing preferred model family labels
  • candidate API ids: the actual model ids to probe, especially for 3.x preview-era models

Current display chains:

  • cheap
    • Prefer gemini-2.5-flash-lite
    • Then gemini-3.1-flash-lite
    • Then gemini-2.5-flash
  • balanced
    • Prefer gemini-2.5-flash
    • Then gemini-3-flash
    • Then gemini-2.5-flash-lite
  • deep
    • Prefer gemini-3-flash
    • Then gemini-2.5-flash
    • Then gemini-3.1-flash-lite

For 3.x models, do not assume the UI label is the raw API id. Probe candidate ids such as preview-suffixed names when needed.

Invocation

Run the Python script or the shell wrapper via exec and request JSON output.

Python is now the canonical entrypoint because it also loads repo-local .env.local when present. The shell wrapper remains a convenience layer.

Primary example (preferred):

python3 skills/gemini-smart-search/scripts/gemini_smart_search.py \
  --query "BoundaryML context engineering" \
  --mode cheap \
  --json

Wrapper example (convenience only):

bash skills/gemini-smart-search/scripts/gemini_smart_search.sh \
  --query "BoundaryML context engineering" \
  --mode cheap \
  --json

python -m gemini_smart_search may work when run from the scripts/ directory, but it is not a supported interface for agents right now. Do not depend on it.

Output contract

Expect JSON with at least:

  • ok
  • query
  • mode
  • model_used
  • fallback_chain
  • display_chain
  • answer
  • citations
  • error
  • escalation

Notes:

  • model_used is the actual probed API model id (for example gemini-3-flash-preview), not the human-facing display label.
  • Citation URLs may initially be Google/Vertex grounding redirect URLs instead of canonical source URLs; treat that as a known current limitation.
  • With --json, supported runtime paths should return structured JSON on both success and error. Invalid CLI arguments now also return JSON when --json is present.

API key policy

The script should prefer a dedicated key path for this skill, then fall back to the standard Gemini key.

Required key resolution order:

  1. SMART_SEARCH_GEMINI_API_KEY (primary declared env)
  2. GEMINI_API_KEY (compatibility fallback)

If neither key is present, the agent must explicitly ask the human for a Gemini API key before claiming setup is complete.

Do not store the key in tracked repository files. Prefer a repo-local, gitignored file such as .env.local.

See references/config.md.

When to use this skill instead of built-in web_search

Use this skill when:

  • you want Gemini-only search
  • you want to test or isolate quota pools
  • you want model routing without touching gateway config
  • you want predictable JSON output for downstream orchestration

Do not use this skill when:

  • a normal built-in web_search is sufficient
  • you need non-Gemini providers
  • you only need to fetch and read a known URL (web_fetch)
  • you need logged-in or JS-heavy page interaction (browser)

Fallback policy

Fallback only for errors like:

  • quota exceeded / 429
  • model unavailable
  • transient upstream failure

Do not silently fallback on obvious local/script bugs or invalid arguments.

References

  • references/config.md — environment variables and design notes
  • references/qa-test-plan.md — focused QA scope for v1 behavior and release gates
  • references/qa-results-2026-03-12.md — CLI-oriented QA outcomes from the current release cycle
  • references/agent-qa-cases.md — adversarial agent-style misuse review
  • references/model-id-recon.md — verified callable Gemini model IDs and mapping notes
  • references/escalation-design.md — when to return a GitHub issue URL for human escalation
  • references/release-checklist.md — artifact release checklist with current completion status
  • references/development-goals-v0.1.1.md — next small version scope and artifact policy
  • references/release-notes-v0.1.1.md — release notes for the current artifact
  • assets/example-output.json — expected response shape
  • scripts/smoke_test.sh — non-destructive local smoke checks for the scaffold
  • scripts/prepare_artifact.sh — deterministic clean artifact export helper

Status

Python implementation is now wired for a first real version:

  • direct Gemini API call path
  • Google Search grounding enabled
  • mode-based model routing
  • Python-side repo-local .env.local loading
  • fallback across Gemini Flash-Lite / Flash variants for retryable upstream errors
  • structured JSON output for orchestration

This is still intentionally minimal: it does not yet expose advanced tuning flags, caching, or richer citation post-processing.

Before publishing an artifact, consult references/release-checklist.md, review references/development-goals-v0.1.1.md, run scripts/prepare_artifact.sh, and publish the release note in references/release-notes-v0.1.1.md alongside the artifact.

安全使用建议
This skill appears coherent and implements what it claims: a local Python-based Gemini search worker that needs a Gemini API key. Before installing: - Confirm you provide SMART_SEARCH_GEMINI_API_KEY (or GEMINI_API_KEY) to the environment; the code prefers SMART_SEARCH_GEMINI_API_KEY. The registry metadata omits required env vars, so ensure the platform supplies the secret to the skill. - Understand the skill will make network calls to Google’s Generative Language API (generativelanguage.googleapis.com) and will send your queries and the API key via the x-goog-api-key header — make sure you’re comfortable with that outbound access and quota/billing implications. - Keep your key in a gitignored .env.local (the repo and scripts already recommend this); verify your CI/agent runtime does not accidentally commit keys. - If you rely on autonomous agent invocation, be aware the agent can call this skill and thereby use your Google key; limit the key's permissions/quota as appropriate and monitor usage. - Minor metadata nit: the registry lists no required env vars while the skill declares SMART_SEARCH_GEMINI_API_KEY as primary; verify the platform/agent will surface that secret when the skill runs. Overall, nothing in the code or docs suggests hidden endpoints, unrelated credential requests, or excessive privileges.
功能分析
Type: OpenClaw Skill Name: gemini-smart-search Version: 0.1.1 The gemini-smart-search skill is a well-documented and functionally aligned tool for performing web searches via the Gemini API with Google Search grounding. The core logic in gemini_smart_search.py uses standard Python libraries (urllib) to communicate exclusively with official Google API endpoints and includes robust error handling and model fallback mechanisms. The bundle demonstrates good security hygiene by explicitly excluding sensitive files like .env.local from its artifact preparation script (prepare_artifact.sh) and providing comprehensive QA and design documentation in the references/ directory. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found.
能力评估
Purpose & Capability
The name/description (Gemini smart search) matches the code and docs: a Python script that calls the Gemini Developer API, provides mode-based routing and fallback, and returns structured JSON. Required binary (python3) and the declared primary credential (SMART_SEARCH_GEMINI_API_KEY) are appropriate for this functionality.
Instruction Scope
SKILL.md instructs running the local Python script (or a thin shell wrapper) and documents .env.local behavior and API key precedence. Runtime actions (reading repo-local .env.local, resolving API key, POST to generativelanguage.googleapis.com, returning JSON) are within the stated purpose. The README/SKILL.md explicitly warns about not tracking keys and about wrapper vs Python entrypoint differences.
Install Mechanism
This is instruction-plus-scripts with no install spec — lowest-risk install model. There are no external download URLs or archive extraction steps. All network use is the expected Gemini API (generativelanguage.googleapis.com) and a static GitHub issue URL for escalation.
Credentials
The skill requires a Gemini API key (primaryEnv = SMART_SEARCH_GEMINI_API_KEY) and falls back to GEMINI_API_KEY; that is proportionate. Minor metadata inconsistency: registry 'Required env vars' field lists none while the skill declares SMART_SEARCH_GEMINI_API_KEY as its primary credential — the declared primary credential is correct for the skill, but the registry metadata could more clearly mark the env var as required.
Persistence & Privilege
always:false (no forced persistent inclusion). The skill only reads a repo-local .env.local and does not modify system-wide configs or other skills. Autonomous invocation is allowed by default (normal for skills) but not elevated here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gemini-smart-search
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gemini-smart-search 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.1
- Added new references: development goals and release notes for v0.1.1. - Included a shell script (prepare_artifact.sh) for deterministic artifact preparation and clean export. - Updated documentation to reference new artifact policy and script usage. - Declared the primary required environment variable (SMART_SEARCH_GEMINI_API_KEY) in metadata. - No functional logic changes to search or fallback behavior; changes are artifact and policy-focused.
v0.1.0
Initial public artifact release of a Gemini-only, script-backed smart search skill for OpenClaw.
元数据
Slug gemini-smart-search
版本 0.1.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

gemini-smart-search 是什么?

Search the web using Gemini with Google Search grounding through a local script, with model routing and quota fallback across Gemini Flash-Lite / Flash varia... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 240 次。

如何安装 gemini-smart-search?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gemini-smart-search」即可一键安装,无需额外配置。

gemini-smart-search 是免费的吗?

是的,gemini-smart-search 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

gemini-smart-search 支持哪些平台?

gemini-smart-search 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 gemini-smart-search?

由 jas0n1ee(@jas0n1ee)开发并维护,当前版本 v0.1.1。

💬 留言讨论