Problem
All the built-in tools passed to LLM are costing tokens and response time. We have so many tools and many of them could be simplified and merged.
We currently have:
HassTurnOn
HassTurnOff
HassSetPosition
HassStartTimer
HassCancelTimer
HassCancelAllTimers
HassIncreaseTimer
HassDecreaseTimer
HassPauseTimer
HassUnpauseTimer
HassTimerStatus
HassBroadcast
HassLightSet
HassClimateSetTemperature
HassMediaUnpause
HassMediaPause
HassMediaNext
HassMediaPrevious
HassSetVolume
HassListAddItem
HassListCompleteItem
Each one has its parameters defined and passed to LLM like:
{
"type": "object",
"properties": {
"hours": {
"type": "integer",
"minimum": 0
},
"minutes": {
"type": "integer",
"minimum": 0
},
"seconds": {
"type": "integer",
"minimum": 0
},
"start_hours": {
"type": "integer",
"minimum": 0
},
"start_minutes": {
"type": "integer",
"minimum": 0
},
"start_seconds": {
"type": "integer",
"minimum": 0
},
"name": {
"type": "string"
},
"area": {
"type": "string"
}
},
"required": []
}
Well its a LOT of tokens. 8904 charactes to be exact.
Proposal
Lets merge some of the tools.
E.g.:
HassTurnOn
& HassTurnOff
- Proposed New Tool:
HassSetDeviceState
(orHassControlDevice
) - Key Parameter:
state
(required, enum:"on"
,"off"
, possibly"toggle"
) - Rationale: These are fundamentally the same action (changing state) on the same types of entities, just with opposite target states. Combining them is very logical. Adding
"toggle"
could cover even more use cases.
We could do similarly:
HassMediaUnpause
,HassMediaPause
,HassMediaNext
,HassMediaPrevious
,HassSetVolume
→HassControlMediaPlayer
HassListAddItem
,HassListCompleteItem
→HassManageList
(orHassControlList
)
and possibly even timers, even though maybe in more than just one tool:
HassStartTimer
,HassCancelTimer
,HassIncreaseTimer
,HassDecreaseTimer
,HassPauseTimer
,HassUnpauseTimer
,HassTimerStatus
(and potentiallyHassCancelAllTimers
) →HassManageTimer
WDYT?