* 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>
* First pass at timers
* Move to separate file
* Refactor to using events
* Add pause/unpause/status
* Add ordinal
* Add test for timed Assist command
* Fix name matching
* Fix IntentHandleError
* Fix again
* Refactor to callbacks
* is_paused -> is_active
* Rename "set timer" to "start timer"
* Move tasks to timer manager
* More fixes
* Remove assist command
* Remove cancel by ordinal
* More tests
* Remove async on callbacks
* Export async_register_timer_handler
* Add thread safety checks to async_create_task
Calling async_create_task from a thread almost always results in an
fast crash. Since most internals are using async_create_background_task
or other task APIs, and this is the one integrations seem to get wrong
the most, add a thread safety check here
* Add thread safety checks to async_create_task
Calling async_create_task from a thread almost always results in an
fast crash. Since most internals are using async_create_background_task
or other task APIs, and this is the one integrations seem to get wrong
the most, add a thread safety check here
* missed one
* Update homeassistant/core.py
* fix mocks
* one more internal
* more places where internal can be used
* more places where internal can be used
* more places where internal can be used
* internal one more place since this is high volume and was already eager_start
* Move HassSetPosition to homeassistant domain
* Add test for unsupported domain with HassSetPosition
* Split service intent handler
* cleanup
---------
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>
* 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
* Use intent responses from home_assistant_intents
* Use error responses from home_assistant_intents
* Remove speech checks for intent tests (set by conversation now)
* Bump hassil and home-assistant-intents versions
* Use Home Assistant JSON reader when loading intents
* Remove speech checks for light tests (done in agent)
* Add more tests for code coverage
* Add test for reloading on new component
* Add test for non-default response
* 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
* Add language to conversation and intent response
* Move language to intent response instead of speech
* Extend intent response for voice MVP
* Add tests for error conditions in conversation/process
* Move intent response type data into "data" field
* Move intent response error message back to speech
* Remove "success" from intent response
* Add id to target in intent response
* target defaults to None
* Update homeassistant/helpers/intent.py
* Fix test
* Return conversation_id and multiple targets
* Clean up git mess
* Fix linting errors
* Fix more async_handle signatures
* Separate conversation_id and IntentResponse
* Add unknown error code
* Add ConversationResult
* Don't set domain on single entity
* Language is required for intent response
* Add partial_action_done
* Default language in almond agent
* Remove partial_action_done
* Fix linting
* Rename success/fail targets
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Add language to conversation and intent response
* Move language to intent response instead of speech
* Extend intent response for voice MVP
* Add tests for error conditions in conversation/process
* Move intent response type data into "data" field
* Move intent response error message back to speech
* Remove "success" from intent response
* Add id to target in intent response
* target defaults to None
* Update homeassistant/helpers/intent.py
* Fix test
* Return conversation_id and multiple targets
* Clean up git mess
* Fix linting errors
* Fix more async_handle signatures
* Separate conversation_id and IntentResponse
* Add unknown error code
* Add ConversationResult
* Don't set domain on single entity
* Language is required for intent response
* Add partial_action_done
* Default language in almond agent
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Add language to conversation and intent response
* Move language to intent response instead of speech
* Extend intent response for voice MVP
* Add tests for error conditions in conversation/process
* Move intent response type data into "data" field
* Move intent response error message back to speech
* Remove "success" from intent response
* Add id to target in intent response
* target defaults to None
* Update homeassistant/helpers/intent.py
* Fix test
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Add language to conversation and intent response
* Add language parameter to conversation/process service
* Move language to intent response instead of speech
* Add language to almond conversation agent
* Fix intent test