Issue with Web Search Grounding in Gemini 2.5 Flash

Description:

I am using the Gemini 2.5 Flash lite model on the vertex-ai Platform to generate content that relies on live web data through the Web Search API.

However, it appears that the web-search functionality is not being triggered during response generation. Even when the prompt explicitly instructs the model to use web search for information retrieval, no search queries are fired, and the model produces generic or static content instead.

Example Use Case:

My use case involves generating short marketing or sales content based on real-time company updates. The prompt explicitly asks the model to reference company initiatives “using Web Search to find” recent information. Despite this, Gemini 2.5 Flash does not seem to perform any live web lookups.

Note:
The prompt I’m using includes a comprehensive set of formatting rules and content-generation instructions that define tone, structure, and style, along with explicit directives to perform web searches.

It seems that Gemini may not be correctly identifying the prompt as one that requires web-search execution. The model might be classifying it as a standard generation prompt rather than one that needs web grounding.

Previously, I believe there was a way to manage this behavior using the dynamic_threshold parameter, but that option doesn’t appear to be available anymore.

I’m using the Go (Golang) genai package from Google.
Has anyone else encountered this issue or found any effective workarounds or configuration changes to ensure web search queries are generated correctly?

1 Like

Same here. gemini 3 works fine though.

Some users have noticed that explicit instructions alone aren’t always enough to trigger live web queries, especially if parameters like dynamic_threshold are no longer available. One workaround is to structure the prompt with a clear “tool invocation” format or use the API’s dedicated web-search fields (if supported) to force grounding.