File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
homeassistant/components/google_generative_ai_conversation Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -254,11 +254,11 @@ async def google_generative_ai_config_option_schema(
254254 )
255255 for api_model in sorted (api_models , key = lambda x : x .display_name or "" )
256256 if (
257- api_model .name != "models/gemini-1.0-pro" # duplicate of gemini-pro
258- and api_model .display_name
257+ api_model .display_name
259258 and api_model .name
260- and api_model .supported_actions
259+ and "tts" not in api_model .name
261260 and "vision" not in api_model .name
261+ and api_model .supported_actions
262262 and "generateContent" in api_model .supported_actions
263263 )
264264 ]
Original file line number Diff line number Diff line change @@ -319,11 +319,10 @@ async def _async_handle_message(
319319 tools .append (Tool (google_search = GoogleSearch ()))
320320
321321 model_name = self .entry .options .get (CONF_CHAT_MODEL , RECOMMENDED_CHAT_MODEL )
322- # Gemini 1.0 doesn't support system_instruction while 1.5 does.
323- # Assume future versions will support it (if not, the request fails with a
324- # clear message at which point we can fix).
322+ # Avoid INVALID_ARGUMENT Developer instruction is not enabled for <model>
325323 supports_system_instruction = (
326- "gemini-1.0" not in model_name and "gemini-pro" not in model_name
324+ "gemma" not in model_name
325+ and "gemini-2.0-flash-preview-image-generation" not in model_name
327326 )
328327
329328 prompt_content = cast (
You can’t perform that action at this time.
0 commit comments