← Back to Home

How to Apply Google Search Grounding Based on Gemini Model Capabilities

Updated March 5, 2026
geminigroundinggoogle searchmodel capabilitiesconfig

Conditional Grounding Pattern

Inject Google Search grounding only when the model and modality support it.

Capability Set

Supported models:

Not supported in this pipeline:

Helper Function

const config = withGoogleSearchGrounding(modelId, existingConfig);

Behavior:

Why Centralize