Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instruct LLM to not pass a list to the domain #118451

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading