openclaw/docs
AkosCz 3a3c2da916
[Feature]: Add Gemini (Google Search grounding) as web_search provider (#13075)
* feat: add Gemini (Google Search grounding) as web_search provider

Add Gemini as a fourth web search provider alongside Brave, Perplexity,
and Grok. Uses Gemini's built-in Google Search grounding tool to return
search results with citations.

- Add runGeminiSearch() with Google Search grounding via tools API
- Resolve Gemini's grounding redirect URLs to direct URLs via parallel
  HEAD requests (5s timeout, graceful fallback)
- Add Gemini config block (apiKey, model) with env var fallback
- Default model: gemini-2.5-flash (fast, cheap, grounding-capable)
- Strip API key from error messages for security
- Add config validation tests for Gemini provider
- Update docs/tools/web.md with Gemini provider documentation

Closes #13074

* feat: auto-detect search provider from available API keys

When no explicit provider is configured, resolveSearchProvider now
checks for available API keys in priority order (Brave → Gemini →
Perplexity → Grok) and selects the first provider with a valid key.

- Add auto-detection logic using existing resolve*ApiKey functions
- Export resolveSearchProvider via __testing_provider for tests
- Add 8 tests covering auto-detection, priority order, and explicit override
- Update docs/tools/web.md with auto-detection documentation

* fix: merge __testing exports, downgrade auto-detect log to debug

* fix: use defaultRuntime.log instead of .debug (not in RuntimeEnv type)

* fix: mark gemini apiKey as sensitive in zod schema

* fix: address Greptile review — add externalContent to Gemini payload, add Gemini/Grok entries to schema labels/help, remove dead schema-fields.ts

* fix(web-search): add JSON parse guard for Gemini API responses

Addresses Greptile review comment: add try/catch to handle non-JSON
responses from Gemini API gracefully, preventing runtime errors on
malformed responses.

Note: FIELD_HELP entries for gemini.apiKey and gemini.model were
already present in schema.help.ts, and gemini.apiKey was already
marked as sensitive in zod-schema.agent-runtime.ts (both fixed in
earlier commits).

* fix: use structured readResponseText result in Gemini error path

readResponseText returns { text, truncated, bytesRead }, not a string.
The Gemini error handler was using the result object directly, which
would always be truthy and never fall through to res.statusText.
Align with Perplexity/xAI/Brave error patterns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style: fix import order and formatting after rebase onto main

* Web search: send Gemini API key via header

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-02-23 09:30:51 -05:00
..
.i18n fix(docs): revert accidental es/pt-BR translation scaffold from #18473 2026-02-17 02:23:41 +01:00
assets docs: add sponsors section to README 2026-02-21 13:00:02 +01:00
automation docs: remove internal hook import paths from examples 2026-02-22 21:12:49 +01:00
channels docs: add synology channel docs and fix unreleased changelog 2026-02-23 01:16:05 +01:00
cli feat: Provider/Mistral full support for Mistral on OpenClaw 🇫🇷 (#23845) 2026-02-23 00:03:56 +00:00
concepts feat: Provider/Mistral full support for Mistral on OpenClaw 🇫🇷 (#23845) 2026-02-23 00:03:56 +00:00
debug Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
diagnostics Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
experiments Tests: isolate quick_validate stub and remove DS_Store 2026-02-23 03:25:37 -05:00
gateway fix(agents): fall back to agents.defaults.model when agent has no model config (#24210) 2026-02-23 03:18:55 -05:00
help feat: Provider/Mistral full support for Mistral on OpenClaw 🇫🇷 (#23845) 2026-02-23 00:03:56 +00:00
images Docs: add screenshot showing model picker usability issue 2026-02-17 09:15:55 +01:00
install docs: fix devices approve command in exe.dev guide 2026-02-22 20:52:46 +01:00
ja-JP docs: fix ja-JP dashboard URL link 2026-02-09 11:26:27 -06:00
nodes feat: Provider/Mistral full support for Mistral on OpenClaw 🇫🇷 (#23845) 2026-02-23 00:03:56 +00:00
platforms chore(release): bump versions to 2026.2.23 2026-02-23 05:13:46 +01:00
plugins fix(voice-call): harden media stream pre-start websocket handling 2026-02-22 23:25:32 +01:00
providers feat: Provider/Mistral full support for Mistral on OpenClaw 🇫🇷 (#23845) 2026-02-23 00:03:56 +00:00
refactor docs: update outbound refactor test path 2026-02-22 21:28:08 +01:00
reference feat: Provider/Mistral full support for Mistral on OpenClaw 🇫🇷 (#23845) 2026-02-23 00:03:56 +00:00
security docs: add missing summary/read_when metadata 2026-02-22 20:45:09 +01:00
start feat: Provider/Mistral full support for Mistral on OpenClaw 🇫🇷 (#23845) 2026-02-23 00:03:56 +00:00
tools [Feature]: Add Gemini (Google Search grounding) as web_search provider (#13075) 2026-02-23 09:30:51 -05:00
web Gateway/UI: data-driven agents tools catalog with provenance (openclaw#24199) thanks @Takhoffman 2026-02-22 23:55:59 -06:00
zh-CN fix(subagents): return completion message for manual session spawns 2026-02-18 02:52:35 +01:00
CNAME refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
brave-search.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
ci.md docs: add missing summaries and read_when hints 2026-02-22 20:37:02 +01:00
date-time.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
docs.json docs: add synology channel docs and fix unreleased changelog 2026-02-23 01:16:05 +01:00
index.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
logging.md Feat/logger support log level validation0222 (#23436) 2026-02-22 11:15:13 +01:00
nav-tabs-underline.js docs(ui): add animated underline for nav tabs (#21912) 2026-02-20 09:33:46 -05:00
network.md docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00
perplexity.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
pi-dev.md docs: replace removed pi test script with current commands 2026-02-22 21:07:34 +01:00
pi.md docs: point pi extension paths to real source files 2026-02-22 21:32:28 +01:00
prose.md docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00
style.css fix(ios): force tls for non-loopback manual gateway hosts (#21969) 2026-02-20 16:28:47 +00:00
tts.md fix(tts): make model provider overrides opt-in 2026-02-21 13:16:07 +01:00
vps.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
whatsapp-openclaw-ai-zh.jpg Docs: add zh-CN landing notice + AI image 2026-02-02 18:35:01 +01:00
whatsapp-openclaw.jpg refactor: rename to openclaw 2026-01-30 03:16:21 +01:00