Commit Graph
114 Commits
Author SHA1 Message Date
epenetandGitHub 7169d52010 Remove import annotations from core (#169547) 2026-04-30 20:34:43 +02:00
Artur PragaczandGitHub f5fef37210 Remove bind_hass usage (#168369) 2026-04-16 15:38:59 +02:00
81f8319af4 Fix llm tool results mutation (#167485)
Co-authored-by: Copilot <[email protected]>
2026-04-13 09:33:37 +02:00
Artur PragaczandGitHub b6ea61f953 Fix run_then_background in service intent handler (#167817) 2026-04-09 21:37:16 +02:00
Artur PragaczandGitHub 8d63c9ccbd Fix set states in service intent handler (#165432) 2026-03-23 23:10:04 +01:00
6ea9e9a161 Remove targets from intent response (#165434)
Co-authored-by: Abílio Costa <[email protected]>
2026-03-18 18:35:30 +00:00
Artur PragaczandGitHub bafef2065f Rework user-given entity name logic (#162763) 2026-03-17 11:09:20 +01:00
Artur PragaczandGitHub 4459dce73a Reorder code to group intent errors (#165431) 2026-03-13 18:58:19 -05:00
Artur PragaczandGitHub a465905467 Remove speech parameter from service intent handler (#165225) 2026-03-13 18:57:16 -05:00
f9bd1b3d30 Rename registry imports in intent helper (#162765)
Co-authored-by: Claude Opus 4.6 <[email protected]>
2026-02-12 00:04:29 -05:00
epenetandGitHub ce6fced6a4 Use StrEnum in intent helper (#162391) 2026-02-06 11:41:58 +01:00
c9351a022e Add HassStopMoving intent for covers and valves (#155267)
Co-authored-by: Artur Pragacz <[email protected]>
2025-12-04 22:23:49 +01:00
Artur PragaczandGitHub b93072865b Clean up unused partial action response in intent helper (#151908) 2025-09-12 19:21:41 +02:00
Artur PragaczandGitHub 1b99ffe61b Pass satellite id through assist pipeline (#151992) 2025-09-11 11:13:23 -05:00
Artur PragaczandGitHub df3d4b5db1 Clean up unused intent category (#151917) 2025-09-08 19:42:23 +02:00
6675b497bd Improve LLM tool descriptions for brightness and volume percentage (#138685)
* Improve tool descriptions for brightness and volume percentage

* Address lint errors

* Update intent.py to revert of a light

* Create explicit types to make intent slots more future proof

* Remove comments about slot type

---------

Co-authored-by: Franck Nijhof <[email protected]>
2025-03-08 22:28:35 -05:00
Michael HansenandGitHub 49c27ae7bc Check area temperature sensors in get temperature intent (#139221)
* Check area temperature sensors in get temperature intent

* Fix candidate check

* Add new code back in

* Remove cruft from climate
2025-02-28 13:02:30 -05:00
Michael HansenandGitHub fca19a3ec1 Move climate intent to homeassistant integration (#139371)
* Move climate intent to homeassistant integration

* Move get temperature intent to intent integration

* Clean up old test
2025-02-28 10:25:38 -05:00
Michael HansenandGitHub 7497beefed Add single target constraint to async_match_targets (#136643)
Add single target constraint
2025-01-27 14:06:21 -05:00
Ville SkyttäandGitHub 40eb8b91cc Adjust to recommended propcache.api import paths (#136150) 2025-01-21 10:58:22 +01:00
Joost LekkerkerkerandGitHub ef8b8fbbaa Enable RUF023 (#135830) 2025-01-17 12:28:27 +01:00
Paulus SchoutsenandGitHub 762bc7b8d1 Add broadcast intent (#135337) 2025-01-16 14:41:53 -06:00
Jan-Philipp BeneckeandGitHub 1a71fbe427 Add intent to cancel all timers (#130873)
* Add intent to cancel all timers

* Add intent to llm test
2024-11-26 09:59:41 -06:00
Michael HansenandGitHub c2ef119e50 Add HassRespond intent (#129755)
* Add HassHello intent

* Rename to HassRespond

* LLM's ignore HassRespond intent
2024-11-03 16:38:52 -06:00
Michael HansenandGitHub 67e0ccf677 Use exposed error messages in Assist (#127503)
* Use exposed error messages

* Report expose errors

* Remove comment

* Relative import

* Rework expose check logic

* Delay creation of all names list, and skip config/hidden entities

* Clean up commented code and type issue

* Fix test

* Move assistant check
2024-10-11 13:06:03 -04:00
J. Nick KostonandGitHub 0f29fd3e10 Switch to using fast cached_property implementation in propcache (#127339) 2024-10-03 13:11:02 -05:00
Allen PorterandGitHub f14471112d Improve LLM tool quality by more clearly specifying device_class slots (#122723)
* Limit intent / llm API device_class slots to only necessary services and limited set of values

* Fix ruff errors

* Run ruff format

* Fix typing and improve output schema

* Fix schema and improve flattening

* Revert conftest

* Revert recorder

* Fix ruff format errors

* Update using latest version of voluptuous
2024-07-31 14:36:02 +02:00
Michael HansenandGitHub 417abda649 Add HassGetCurrentDate and HassGetCurrentTime intents (#121707) 2024-07-11 00:17:04 +02:00
Marc MuellerandGitHub d527113d59 Improve schema typing (3) (#120521) 2024-06-26 11:30:07 +02:00
Marc MuellerandGitHub 185e79fa1b Improve intent schema typing (#120442) 2024-06-25 19:02:04 +02:00
2386ed3830 Add script llm tool (#118936)
* Add script llm tool

* Add tests

* More tests

* more test

* more test

* Add area and floor resolving

* coverage

* coverage

* fix ColorTempSelector

* fix mypy

* fix mypy

* add script reload test

* Cache script tool parameters

* Make custom_serializer a part of api

---------

Co-authored-by: Michael Hansen <[email protected]>
2024-06-25 10:43:26 -05:00
6b8bddf6e3 Make remaining time of timers available to LLMs (#118696)
* Include speech_slots in IntentResponse.as_dict

* Populate speech_slots only if available

* fix typo

* Add test

* test all fields

* Fix another test

---------

Co-authored-by: Paulus Schoutsen <[email protected]>
2024-06-14 20:47:41 +02:00
5f9455e0fd Log errors in Intent.async_handle (#119182)
* Log errors in Intent.async_handle

* log exception stack trace

* Update homeassistant/helpers/intent.py

---------

Co-authored-by: Paulus Schoutsen <[email protected]>
2024-06-10 11:33:12 -04:00
Michael HansenandGitHub 87114bf19b Fix exposure checks on some intents (#118988)
* Check exposure in climate intent

* Check exposure in todo list

* Check exposure for weather

* Check exposure in humidity intents

* Add extra checks to weather tests

* Add more checks to todo intent test

* Move climate intents to async_match_targets

* Update test_intent.py

* Update test_intent.py

* Remove patch
2024-06-06 20:41:25 -05:00
d223e1f2ac Add Conversation command to timers (#118325)
* Add Assist command to timers

* Rename to conversation_command. Execute in timer code.

* Make agent_id optional

* Fix arg

---------

Co-authored-by: Paulus Schoutsen <[email protected]>
2024-05-28 20:33:31 -05:00
Michael HansenandGitHub 2dc49f0410 Add platforms to intent handlers (#118328) 2024-05-28 16:46:08 -04:00
f99ec87338 Fail if targeting all devices in the house in service intent handler (#117930)
* Fail if targeting all devices in the house

* Update homeassistant/helpers/intent.py

---------

Co-authored-by: Paulus Schoutsen <[email protected]>
2024-05-22 13:53:31 -04:00
Michael HansenandGitHub 8079cc0464 Add description to intent handlers and use in LLM helper (#117864) 2024-05-21 12:54:34 -04:00
Marc MuellerandGitHub 87bb7ced79 Use PEP 695 for simple type aliases (#117633) 2024-05-17 14:42:21 +02:00
f31873a846 Add LLM tools (#115464)
* 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 <[email protected]>
Co-authored-by: Paulus Schoutsen <[email protected]>
2024-05-15 19:16:47 -04:00
Paulus SchoutsenandGitHub 4aba92ad04 Fix the type of slot schema of intent handlers (#117520)
Fix the slot schema of dynamic intenet handler
2024-05-15 16:45:15 -04:00
Paulus SchoutsenandGitHub 8f9273e945 Fix intent_type type (#117469) 2024-05-14 21:32:11 -07:00
Michael HansenandGitHub 641754e0bb Pass device_id to intent handlers (#117442) 2024-05-14 13:59:49 -05:00
Michael HansenandGitHub add6ffaf70 Add Assist timers (#117199)
* 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
2024-05-14 14:42:32 -04:00
Michael HansenandGitHub 7923471b94 Intent target matching and media player enhancements (#115445)
* Working

* Tests are passing

* Fix climate

* Requested changes from review
2024-05-07 22:01:03 -04:00
Marc MuellerandGitHub 2db64c7e6d Use HassKey for helpers (1) (#117012) 2024-05-07 11:25:16 -05:00
SidandGitHub 2cc916db6d Replace pylint broad-except with Ruff BLE001 (#116250) 2024-05-07 14:00:27 +02:00
J. Nick KostonandGitHub 164403de20 Add thread safety checks to async_create_task (#116339)
* 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
2024-04-28 18:29:00 -04:00
SidandGitHub 3799d20d43 Enable Ruff B905 (#114197) 2024-04-14 00:14:26 -05:00
8e98ba7312 Add first batch of Ruff PYI rules (#115100)
Co-authored-by: Jan Bouwhuis <[email protected]>
2024-04-07 11:30:50 -10:00