* Add llm helper
* break out Tool.specification as class members
* Format state output
* Fix intent tests
* Removed auto initialization of intents - let conversation platforms do that
* Handle DynamicServiceIntentHandler.extra_slots
* Add optional description to IntentTool init
* Add device_id and conversation_id parameters
* intent tests
* Add LLM tools tests
* coverage
* add agent_id parameter
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* Fix tests
* Fix intent schema
* Allow a Python function to be registered as am LLM tool
* Add IntentHandler.effective_slot_schema
* Ensure IntentHandler.slot_schema to be vol.Schema
* Raise meaningful error on tool not found
* Move this change to a separate PR
* Update todo integration intent
* Remove Tool constructor
* Move IntentTool to intent helper
* Convert custom serializer into class method
* Remove tool_input from FunctionTool auto arguments to avoid recursion
* Remove conversion into Open API format
* Apply suggestions from code review
* Fix tests
* Use HassKey for helpers (see #117012)
* Add support for functions with typed lists, dicts, and sets as type hints
* Remove FunctionTool
* Added API to get registered intents
* Move IntentTool to the llm library
* Return only handlers in intents.async.get
* Removed llm tool registration from intent library
* Removed tool registration
* Add bind_hass back for now
* removed area and floor resolving
* fix test
* Apply suggestions from code review
* Improve coverage
* Fix intent_type type
* Temporary disable HassClimateGetTemperature intent
* Remove bind_hass
* Fix usage of slot schema
* Fix test
* Revert some test changes
* Don't mutate tool_input
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Add valve to HassTurnOn/Off
* Add set position for valves
* Add set position to covers
* Add HassTurnOn/Off for vacuums
* Add media player intents
* Split out vacuum intents
* Address comments
* Extra test
* Update return signature of service calls
* Add timeout error handling in websocket api for service calls
* Update recorder tests to remove assertion on service call
* Remove timeout behavior and update callers that depend on it today
* Fix tests
* Add missing else
* await coro directly
* Fix more tests
* Update the intent task to use wait instead of timeout
* Remove script service call limits and limit constants
* Update tests that depend on service call limits
* Use wait instead of wait_for and add test
* Update homeassistant/helpers/intent.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* support live reload of intent_script
* add services.yaml
* update tesls for full code coverage
* Update based on feedback
* fix intent_script reload when no intent_script config
* Update homeassistant/helpers/intent.py
* update tests to handle no_existing better
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Actually use translated state names in response
* Change test result now that locks are excluded from HassTurnOn
* Bump home-assistant-intents and hassil versions
* Only expose default cloud domains in default agent
* Copy exposed domain list to conversation
* Implement requested changes
* Add test for exposed devices/areas
* Use blocking in service calls and verify result
* Block for 2 seconds and update states after
* Small timeout in service call to allow exceptions
* Move sun test
* Refactor async_match_states
* Check entity name after state, before aliases
* Give entity name matches priority over area names
* Don't force result to have area
* Add area alias in tests
* Move name/area list creation back
* Clean up PR
* More clean up
* Move entity/area resolution to async_match_states
* Special case for covers in HassTurnOn/Off
* Enable light color/brightness on areas
* Remove async_register from default agent
* Remove CONFIG_SCHEMA from conversation component
* Fix intent tests
* Fix light test
* Move entity/area resolution to async_match_states
* Special case for covers in HassTurnOn/Off
* Enable light color/brightness on areas
* Remove async_register from default agent
* Remove CONFIG_SCHEMA from conversation component
* Fix intent tests
* Fix light test
* Fix humidifier intent handlers
* Remove DATA_CONFIG for conversation
* Copy ServiceIntentHandler code to light
* Add proper errors to humidifier intent handlers
When using fuzzy matching to match entity names for intents, whichever
entity is first is preferred in the case of equal matches. This leads
to situations where entities with similar names (such as entities named
for their area and then specific area location) may be used when the
whole area is wanted.
I ran into this with the my Phillips Hue lights. I have each individual
light named such that its room is the first part of the name, and its
location within the room after. So my living room has:
Living Room West
Living Room Northwest
Living Room North
Living Room Northeast
I then have a group for the whole room:
Living Room
Because the group is the last of the entities, trying to adjust the
whole room only activates one light, because all of the lights match
equally well.
By preferring the shortest of equal matches, we prefer keys that have
the least amount of extra information, causing "Living Room" to match
the group instead of an individual light.