I have a weird issue with Google Generative AI (using recommended model settings). Most of my commands work fine, but some commands consistently fail with the error message “Unable to generate response”. Simply asking to turn on the kitchen light will almost always fail. If I ask if the light is on, it knows about it though and in a follow-up question is can actually turn it on.
In the system log, I get these errors:
Logger: homeassistant.components.conversation.util
Source: components/conversation/util.py:35
integration: Conversation (documentation, issues)
First occurred: 9:07:20 AM (11 occurrences)
Last logged: 2:51:08 PM
Last content in chat log is not an AssistantContent: UserContent(role='user', content='turn off dinner table light', attachments=None). This could be due to the model not returning a valid response
Last content in chat log is not an AssistantContent: UserContent(role='user', content='turn off the kitchen light', attachments=None). This could be due to the model not returning a valid response
Last content in chat log is not an AssistantContent: UserContent(role='user', content='turn on the kitchen light', attachments=None). This could be due to the model not returning a valid response
Last content in chat log is not an AssistantContent: UserContent(role='user', content='turn on the living room light', attachments=None). This could be due to the model not returning a valid response
Last content in chat log is not an AssistantContent: UserContent(role='user', content='turn on the lights in the living room', attachments=None). This could be due to the model not returning a valid response
Any idea how I can understand what is happening? Interestingly, when I switch to gemini-2.5-pro, I get a more elaborate error:
This error is just repeated in the logs:
Logger: homeassistant.components.google_generative_ai_conversation
Source: components/google_generative_ai_conversation/entity.py:308
integration: Google Generative AI (documentation, issues)
First occurred: 8:58:40 AM (6 occurrences)
Last logged: 2:57:57 PM
Error sending message: <class 'google.genai.errors.ServerError'> 500 Internal Server Error. {'message': '{\n "error": {\n "code": 500,\n "message": "An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting",\n "status": "INTERNAL"\n }\n}\n', 'status': 'Internal Server Error'}
According to that webpage, it would be a server error, hinting that the input context might be too large. But that seems odd since other commands seem to work fine? I do have 130 devices exposed though?


