mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Update LLM prompt to improve quality for local LLMs (#122746)
This commit is contained in:
@@ -324,8 +324,7 @@ class AssistAPI(API):
|
||||
(
|
||||
"When controlling Home Assistant always call the intent tools. "
|
||||
"Use HassTurnOn to lock and HassTurnOff to unlock a lock. "
|
||||
"When controlling a device, prefer passing just its name and its domain "
|
||||
"(what comes before the dot in its entity id). "
|
||||
"When controlling a device, prefer passing just name and domain. "
|
||||
"When controlling an area, prefer passing just area name and domain."
|
||||
)
|
||||
]
|
||||
@@ -363,7 +362,7 @@ class AssistAPI(API):
|
||||
prompt.append(
|
||||
"An overview of the areas and the devices in this smart home:"
|
||||
)
|
||||
prompt.append(yaml.dump(exposed_entities))
|
||||
prompt.append(yaml.dump(list(exposed_entities.values())))
|
||||
|
||||
return "\n".join(prompt)
|
||||
|
||||
@@ -477,6 +476,7 @@ def _get_exposed_entities(
|
||||
|
||||
info: dict[str, Any] = {
|
||||
"names": ", ".join(names),
|
||||
"domain": state.domain,
|
||||
"state": state.state,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user