mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
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
This commit is contained in:
parent
117a02972d
commit
f4a876c590
@ -282,7 +282,7 @@ class AssistAPI(API):
|
|||||||
else:
|
else:
|
||||||
prompt.append(
|
prompt.append(
|
||||||
"When a user asks to turn on all devices of a specific type, "
|
"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(
|
if not tool_context.device_id or not async_device_supports_timers(
|
||||||
|
@ -432,7 +432,7 @@ async def test_assist_api_prompt(
|
|||||||
|
|
||||||
area_prompt = (
|
area_prompt = (
|
||||||
"When a user asks to turn on all devices of a specific type, "
|
"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)
|
api = await llm.async_get_api(hass, "assist", tool_context)
|
||||||
assert api.api_prompt == (
|
assert api.api_prompt == (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user