diff --git a/homeassistant/components/google_generative_ai_conversation/config_flow.py b/homeassistant/components/google_generative_ai_conversation/config_flow.py index 551f9b0c9de..ae0f09b1037 100644 --- a/homeassistant/components/google_generative_ai_conversation/config_flow.py +++ b/homeassistant/components/google_generative_ai_conversation/config_flow.py @@ -254,11 +254,11 @@ async def google_generative_ai_config_option_schema( ) for api_model in sorted(api_models, key=lambda x: x.display_name or "") if ( - api_model.name != "models/gemini-1.0-pro" # duplicate of gemini-pro - and api_model.display_name + api_model.display_name and api_model.name - and api_model.supported_actions + and "tts" not in api_model.name and "vision" not in api_model.name + and api_model.supported_actions and "generateContent" in api_model.supported_actions ) ] diff --git a/homeassistant/components/google_generative_ai_conversation/conversation.py b/homeassistant/components/google_generative_ai_conversation/conversation.py index 73a82b98664..c642bfd94e6 100644 --- a/homeassistant/components/google_generative_ai_conversation/conversation.py +++ b/homeassistant/components/google_generative_ai_conversation/conversation.py @@ -319,11 +319,10 @@ class GoogleGenerativeAIConversationEntity( tools.append(Tool(google_search=GoogleSearch())) model_name = self.entry.options.get(CONF_CHAT_MODEL, RECOMMENDED_CHAT_MODEL) - # Gemini 1.0 doesn't support system_instruction while 1.5 does. - # Assume future versions will support it (if not, the request fails with a - # clear message at which point we can fix). + # Avoid INVALID_ARGUMENT Developer instruction is not enabled for supports_system_instruction = ( - "gemini-1.0" not in model_name and "gemini-pro" not in model_name + "gemma" not in model_name + and "gemini-2.0-flash-preview-image-generation" not in model_name ) prompt_content = cast(