mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +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
b5ec24ef63
commit
0d6c7d0973
@ -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