Skip to content

Commit

Permalink
Instruct LLM to not pass a list to the domain (#118451)
Browse files Browse the repository at this point in the history
  • Loading branch information
tronikos authored and frenck committed May 30, 2024
1 parent 3e0d951 commit 4834283
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion homeassistant/helpers/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,10 @@ def _async_get_api_prompt(
prompt = [
(
"Call the intent tools to control Home Assistant. "
"Do not pass the domain to the intent tools as a list. "
"When controlling a device, prefer passing just its name and its domain "
"(what comes before the dot in its entity id). "
"When controlling an area, prefer passing just area name and a single domain."
"When controlling an area, prefer passing just area name and domain."
)
]
area: ar.AreaEntry | None = None
Expand Down
3 changes: 2 additions & 1 deletion tests/helpers/test_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,10 @@ def create_entity(device: dr.DeviceEntry, write_state=True) -> None:
)
first_part_prompt = (
"Call the intent tools to control Home Assistant. "
"Do not pass the domain to the intent tools as a list. "
"When controlling a device, prefer passing just its name and its domain "
"(what comes before the dot in its entity id). "
"When controlling an area, prefer passing just area name and a single domain."
"When controlling an area, prefer passing just area name and domain."
)
no_timer_prompt = "This device does not support timers."

Expand Down

0 comments on commit 4834283

Please sign in to comment.