-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Generative AI crashes when it gives a empty string as reply. #136019
Comments
Hey there @tronikos, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) google_generative_ai_conversation documentation |
This seems to happen for me using 2025.2.3 with the Voice Assistant PE. I have three voice pipelines setup. ChatGPT, GoogleAI, and Local control. The LLMs are using local intents with LLM failback. It isn't consistent but if I switch to one of the non-Google pipelines and use it for a bit, and then come back to GoogleAI, it get this error. The odd thing is, it happens on the one PE only. The other one can still query Google just fine. I can swap to ChatGPT and it also works fine, but move back to GoogleAI and I get the exact error above. The only solution is to power cycle the PE by literally pulling the USB cable from the wall.
|
Hi there. I am very new to home assistant and came across the same issue. So a simple fix was to change my automation to say "ok" instead of nothing. But still...it bothered me. I hope it helps. I did not yet take a look at the google gen ai API, maybe there is a way to avoid this error without changing the content of the history. |
Is this an issue with OpenAI or Ollama? |
Good question. |
The problem
Hard to reproduce issue but the Google Generative AI integration crashes when it gives a empty reply.
I have a voicemail system. where an automation (that catches everything) triggers an google AI prompt. and then has a switch case based on scripts triggered by the AI. (pass through the call, send a message to pickup phone, plan a meeting, voicemail, block call)
now does the block call resulted in a empty response twice.
I try to get a message how to behave better in society but i only get replies like phone call disconnected.
If the prompt returned a empty reply the next reply will fail.
2025-01-19 11:54:19.485 ERROR (MainThread) [homeassistant.components.google_generative_ai_conversation] Error sending message: <class 'google.api_core.exceptions.InvalidArgument'> 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
I use the conversation_id my guess is that there is a void in the chat history that is send with the prompt.
but I'm unable to reproduces the issue any more. so i cant validate what happens when i change the conversation id.
Note this issue is hard to reproduce. i tried to reproduce it by forcing the prompt to reply with a empty reply but then it says ""
It has to do with running some script the LLM has personal "feelings" with. (normal scripts (I have like 20+ LLM scripts already) work fine.
Personal like it is trained to not allow unwanted conversations and fails back to training no matter what the prompt instructs the LLM to do.
I cant share my prompt with out edit it because it has personal rules to allow phone calls.
What version of Home Assistant Core has the issue?
core-2025.1.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Google Generative AI
Link to integration documentation on our website
https://www.home-assistant.io/integrations/google_generative_ai_conversation
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: