Gemini 2.5 Pro with empty response.text

Thanks for sharing @Oscar_Hoffmann.

So till now i have encountered various versions of this issue :
. it doesn’t return any text or return empty response
. it returns couple of words then ------ till token ends, this is worse as no error is detected
. it directly returns -------
. But mostly it returns empty response , sometimes after couple of minutes wait.
we cant use either 2.5 flash or 2.5 pro in production
they both seemed very promising but not reliable at all.
been months being a visitor here in hope it will get resolved but still dissapointed, i thought after IO 2025 it would be different. Very market immature LLM.
response:
GenerateContentResponse(
done=True,
iterator=None,
result=protos.GenerateContentResponse({
“candidates”: [
{
“content”: {
“role”: “model”
},
“finish_reason”: “STOP”,
“index”: 0
}
],
“usage_metadata”: {
“prompt_token_count”: 518,
“total_token_count”: 6628
},
“model_version”: “models/gemini-2.5-flash-preview-05-20”
}),
)

same issue, empty response when using 2.5 flash. makes it very hard to rely on

Getting the same issue here. One thing to add on is that this problem just become so dominant(like 2/3) after i add mcp tools support to my framework.

When I change back to the stable model instead of using the preview one, problem seems to be solved.

@GUNAND_MAYANGLAMBAM Any updates on this? The seemingly random, yet frequent occurrence of this issues is hard to work around in production. Currently we are seeing this issue in about 1 out of 4 calls, exclusively with search grounded calls.

Added: Switching to Gemini 2.5 stable models has not resolved the situation for us, empty responses still occur, roughly with same frequency.

yes problem doesn’t seems to exist or supressed in stable models but they are too underperforming when compared to latest preview model both flash and pro.

Problem still exists for us with the stable models. I’ve been using flash a lot and the problem seems worse there than with pro (which still has the issue)

Problem seems to have got worsen.

Did you implement the retry logic suggested by @Bryan_Hughes? This is a proper workaround for now. We increased the retry limit to 10 (!!!) and this seems to at least always generate a valid output at some point. The problem for our use-case is that IF Gemini 2.5 Pro generates output its by far superior AND the cheapest compared to all other LLM’s out there. This thread is getting pretty long and persistant. I expect more involvement and communication from Google.

yes i did but still sometimes it returns empty response and sometime even gives garbage out such as -------- or few words and ----------, these cases makes it difficult to even catch the error, i am using it to transcript handwritten texts then making those texts into some structured outputs.

i am still facing this issue with ‘gemini 2.5-flash’ model, is there any solution for this?

Ran into the same issue. After some prompt engineering, I managed to get results out of Gemini.