generative-ai-python icon indicating copy to clipboard operation
generative-ai-python copied to clipboard

Unable to submit request because it has an empty text parameter. Add a value to the parameter and try again. #697

Open Captainnik53 opened this issue 8 months ago • 3 comments

Description of the bug:

Getting this issue again, can you please have a quick look?

https://github.com/google-gemini/deprecated-generative-ai-python/issues/697

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response

Captainnik53 avatar Apr 08 '25 16:04 Captainnik53

@hkt74 - you solved #697, do you know what's going on here?

MarkDaoust avatar Apr 10 '25 15:04 MarkDaoust

Hi @Captainnik53

To help us investigate the issue, Could you confirm if you getting this error from Vertex client or Gemini API client? I notice the error is from Vertex client, while Gemini API returns success.

As far as I known, model wouldn't return meaningful response when sending empty text request, Could you share about your use case here? and want to explore if it is possible to make the change on the client side to filter out empty text request. thanks!

hkt74 avatar Apr 28 '25 20:04 hkt74

Hi @Captainnik53

To help us investigate the issue, Could you confirm if you getting this error from Vertex client or Gemini API client? I notice the error is from Vertex client, while Gemini API returns success.

As far as I known, model wouldn't return meaningful response when sending empty text request, Could you share about your use case here? and want to explore if it is possible to make the change on the client side to filter out empty text request. thanks!

We are using the Gemini API Client, specifically the [Gemini 2.0 Flash model](https://ai.google.dev/gemini-api/docs/models#gemini-2.0-flash).

It appears that in a chat session, if a function call fails and results in a malformed function call, the model subsequently stops responding to any further queries in that same session. Instead, it returns the following error:

Invalid argument provided to Gemini: 400 Unable to submit request because it has an empty text parameter. Add a value to the parameter and try again. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini

This behavior seems consistent once the malformed call occurs, effectively halting further interaction in the current session.

utkarsh-alpuria avatar May 12 '25 09:05 utkarsh-alpuria