Skip to content

feat(runtime): add Gemini Google Search grounding - #5054

Open
wutongyuonce wants to merge 2 commits into
apache:mainfrom
wutongyuonce:feat/runtime-gemini-google-search
Open

feat(runtime): add Gemini Google Search grounding#5054
wutongyuonce wants to merge 2 commits into
apache:mainfrom
wutongyuonce:feat/runtime-gemini-google-search

Conversation

@wutongyuonce

Copy link
Copy Markdown

Refs #4330 (Gemini grounding slice).

Attach provider-native google-search for Gemini 3+ only. @ai-sdk/google drops function tools when googleSearch is mixed on Gemini 2.x, so 2.0/2.5 stay implemented: false. No Tavily fallback; OpenRouter Gemini does not compile google-search.

Enable google-grounding for first-party Gemini families and lower it through
the official @ai-sdk/google googleSearch provider tool. Native search stays
fail-closed: incognito strips it, tavily stays tavily, and unsupported wires
still drop the tool instead of falling back.

Generated-by: Claude
@ai-sdk/google drops function tools when googleSearch is present on
pre-Gemini-3 models. Keep google-grounding implemented only for Gemini 3+
and strip native WebSearch on 2.0/2.5 so Read/Write/Bash stay on the
request. Do not silently fall back to Tavily.

Generated-by: Claude
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant