From 0d6c7d097348ecf86f0d0cb6db2ba5b1803b1978 Mon Sep 17 00:00:00 2001 From: tronikos Date: Thu, 30 May 2024 14:14:11 -0700 Subject: [PATCH] Fix LLMs asking which area when there is only one device (#118518) * Ignore deprecated open and close cover intents for LLMs * Fix LLMs asking which area when there is only one device * remove unrelated changed * remove unrelated changes --- homeassistant/helpers/llm.py | 2 +- tests/helpers/test_llm.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/helpers/llm.py b/homeassistant/helpers/llm.py index ce539de1fd7..5591c4a8aba 100644 --- a/homeassistant/helpers/llm.py +++ b/homeassistant/helpers/llm.py @@ -282,7 +282,7 @@ class AssistAPI(API): else: prompt.append( "When a user asks to turn on all devices of a specific type, " - "ask user to specify an area." + "ask user to specify an area, unless there is only one device of that type." ) if not tool_context.device_id or not async_device_supports_timers( diff --git a/tests/helpers/test_llm.py b/tests/helpers/test_llm.py index 63c1214dd6d..1c13d643928 100644 --- a/tests/helpers/test_llm.py +++ b/tests/helpers/test_llm.py @@ -432,7 +432,7 @@ async def test_assist_api_prompt( area_prompt = ( "When a user asks to turn on all devices of a specific type, " - "ask user to specify an area." + "ask user to specify an area, unless there is only one device of that type." ) api = await llm.async_get_api(hass, "assist", tool_context) assert api.api_prompt == (