Commit Graph
99 Commits
Author SHA1 Message Date
Nicolas Mowen 10ce428387 Handle case where GetLiveContext includes an entity with StrEnum key (#174822) 2026-06-25 19:53:32 +02:00
Abílio Costa dc6269f52d Add override decorator to remaining homeassistant dir files (#174488) 2026-06-22 21:56:03 +02:00
Franck Nijhof 2a0b5ca895 Sort aliases in LLM prompts for stable prefix caching (#173558) 2026-06-12 18:56:38 +02:00
Paulus SchoutsenandClaude d098622021 Return all matches for duplicate names in GetLiveContext (#173157)
Co-authored-by: Claude <noreply@anthropic.com>
2026-06-07 21:50:15 -04:00
Michael Hansen ba9248cc94 LLM: format numeric states with display precision (#173128) 2026-06-06 12:15:48 -04:00
skye-harris 9fd48344f8 Reorder device location context towards the end of the Assist LLM instructions (#165136) 2026-05-23 20:51:17 -07:00
Franck NijhofandClaude Opus 4.6 eae809abd1 Fix line length violations in core and helpers (#170534)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-14 16:31:01 -04:00
epenet 7169d52010 Remove import annotations from core (#169547) 2026-04-30 20:34:43 +02:00
Nicolas MowenandCopilot d956af095e Add ability to filter GetLiveContext tool (#168457)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-28 22:08:29 -07:00
Artur Pragacz bafef2065f Rework user-given entity name logic (#162763) 2026-03-17 11:09:20 +01:00
Paulus Schoutsen 257e82fe4e Add multiple selection to media selector (#154350) 2025-11-04 01:44:31 +01:00
34ab725b75 LLM prefix caching optimization using new GetDateTime tool (#152408)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Denis Shulyaka <Shulyaka@gmail.com>
2025-10-16 12:47:12 -04:00
Paulus SchoutsenandMichael Hansen 3c001bd6ed Revert "Expose the entity_id of an entity to LLMs" (#154561)
Co-authored-by: Michael Hansen <mike@rhasspy.org>
2025-10-15 16:07:34 -04:00
Omer Korner e2c281549e Expose the entity_id of an entity to LLMs (#149428) 2025-10-15 21:24:32 +02:00
Abílio Costa ca1c366f4f Remove unused var from llm helper (#152724) 2025-09-22 09:57:16 +02:00
michnovkaandMichael Hansen d990c2bee2 Fix timestamps exposed to LLM to be in local timezone (#139825)
Co-authored-by: Michael Hansen <mike@rhasspy.org>
2025-09-08 14:51:17 -05:00
Artur Pragacz d5c208672e Add TARGET_FIELDS to config validation (#150238) 2025-08-26 19:40:39 +01:00
Denis Shulyaka 80e720f663 Add external tools support for chat log (#150461) 2025-08-16 12:20:20 +02:00
Paulus Schoutsen 1734b316d5 Return intent response from LLM chat log if available (#148522) 2025-07-16 16:16:01 +02:00
Paulus Schoutsen e6702d2392 Serialize Object Selector correctly if a field is required (#148577) 2025-07-10 22:45:56 +01:00
Paulus Schoutsen 4f4ec6f41a Add Google Gen AI structured data support (#148143) 2025-07-05 08:22:17 -07:00
Denis Shulyaka 3151713a34 Replace dot with underscores for NamespacedTool and ActionTool (#147764) 2025-07-05 11:27:27 +02:00
Allen Porter 1fc624c7a7 Update LLM selector serializer to support ObjectSelector fields and arrays (#148094) 2025-07-04 13:05:16 +02:00
Marc Mueller 2c13c70e12 Update ruff to 0.12.0 (#147106) 2025-06-19 20:39:09 +02:00
Erik Montnemery 0db6520802 Add comment in helpers.llm.ActionTool explaining limitations (#147116) 2025-06-19 12:59:35 +02:00
Paulus Schoutsen 059c12798d Drop user prompt from LLMContext (#146787) 2025-06-13 22:01:39 -04:00
Allen Porter b16151ac6d Add an LLM tool for fetching todo list items (#143777)
* Add a tool for fetching todo list items

* Simplify the todo list interface by adding an "all" status

* Update prompt to improve performance on smaller models
2025-04-30 08:49:33 -04:00
Allen Porter d924f0b1d6 Improve the live context tool prompt with additional instructions (#143746)
* Improve the live context tool prompt with additional instructions

* Fix vertical whitespace
2025-04-30 08:47:54 -04:00
Allen Porter db043b26da Fix quality loss for LLM conversation agent question answering (#142873)
* Fix a bug parsing a streaming response with no json

* Remove debug lines

* Fix  quality loss for LLM conversation agent question answering

* Update tests
2025-04-14 10:05:34 +02:00
Allen PorterandPaulus Schoutsen d91528648f Update ollama to allow selecting mutiple LLM APIs (#142445)
* Update ollama to allow selecting mutiple LLM APIs

* Update homeassistant/helpers/llm.py

* Avoid gather since these don't do I/O

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2025-04-13 15:37:46 -07:00
John Karabudak 85d2e3d006 Fix LLM to speed up prefill (#141156)
* fix: two minor LLM changes to speed up prefill

- moved the current date/time to the end of the prompt
- started sorting all entities by last_changed

* addressed PR comments

* fixed tests

* reduced scope of try/catch in LLM prompt

* addressed more PR comments

* fixed Anthropic test

* addressed another PR comment

* fixed remainder of tests
2025-03-30 13:30:40 -07:00
Allen Porter 4e2dfba45f Omit state from the Assist LLM prompts (#141034)
* Omit state from the Assist LLM prompts

* Add back the stateful prompt
2025-03-22 15:41:51 -04:00
Allen Porter a83bf4f514 Add a GetHomeState tool to return the current state of the home (#140971)
* Add a GetHomeState tool to return the current state of the home

* Fix check for exposing entities

* Add "all" to get home state description
2025-03-20 19:37:54 -07:00
Michael Hansen 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
Paulus Schoutsen ac42c9386c Simplify llm calendar tool (#137402)
* Simplify calendar tool

* Clean up exposed entities
2025-02-05 11:42:41 +01:00
Paulus Schoutsen 9679fc7878 Chat session rev2 (#137209)
* Chat Session rev 2

* Rename session to chat_log

* Simplify typing

* Typing

* Address comments

* Fix anthropic and ollama
2025-02-03 00:05:20 -05:00
Allen Porter bf6f790d09 Remove entity state from mcp-server prompt (#137126)
* Create a stateless assist API for MCP server

* Update stateless API

* Fix areas in exposed entity fields

* Add tests that verify areas are returned

* Revert the getstate intent

* Revert whitespace change

* Revert whitespace change

* Revert method name changes to avoid breaking openai and google tests
2025-02-01 14:26:52 -08:00
Denis Shulyaka 85540cea3f Add LLM ActionTool (#136591)
Add ActionTool
2025-01-27 14:21:27 -05:00
Paulus Schoutsen 005ae3ace6 Allow LLMs to get calendar events from exposed calendars (#136304) 2025-01-23 17:54:04 -05:00
epenet b11b36b523 Add more util aliases to import conventions (#136153) 2025-01-21 15:58:23 +01:00
Paulus Schoutsen 754de6f998 Add shared history for conversation agents (#135903)
* Add shared history for conversation agents

* Remove unused code

* Add support for native history items

* Store all assistant responses as assistant in history

* Add history support to DefaultAgent.async_handle_intents

* Make local fallback work

* Add default agent history

* Add history cleanup

* Add tests

* ChatHistory -> ChatSession

* Address comments

* Update snapshots
2025-01-18 22:33:03 -05:00
Allen Porter 6e111d18ec Allow unregistering LLM APIs (#135162) 2025-01-09 08:18:25 -08:00
Paulus Schoutsen ae34a6b375 Do not double expose scripts in LLM tools (#131726) 2024-11-27 18:04:08 +01:00
Paulus Schoutsen 7e03100af2 Allow an LLM to see script response values (#131683) 2024-11-26 23:51:21 -06:00
Michael Hansen c2ef119e50 Add HassRespond intent (#129755)
* Add HassHello intent

* Rename to HassRespond

* LLM's ignore HassRespond intent
2024-11-03 16:38:52 -06:00
tronikos 267e1dd0f8 Partially revert "LLM Tool parameters check (#123621)" (#129064) 2024-10-25 11:23:34 +02:00
Denis Shulyaka e0e61b5262 Expose scripts with no fields as entities (#123061) 2024-10-22 23:14:07 -07:00
Joost LekkerkerkerandErik Montnemery a1906b434f Change trigger platform key to trigger (#124357)
* fix

* Fix

* Fix

* Update homeassistant/helpers/config_validation.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Fix

* Fix

* Fix

* Fix

* Add more tests

* Fix

* Fix tests

* Add tests

* Let's see what the CI does

* It fails on the code that tested the thing ofc

* It fails on the code that tested the thing ofc

* Revert test thingy

* Now the test works again, lovely

* Another one

* Fix websocket thingy

* Only copy when needed

* Improve comment

* Remove test

* Fix docstring

* I think this now also work since this transforms trigger to platform

* Add comment

* Update homeassistant/helpers/config_validation.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/helpers/config_validation.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/helpers/config_validation.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Check for mapping

* Add test

* Update homeassistant/helpers/config_validation.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update test to also test for trigger keys

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-09-25 14:19:58 +02:00
epenet 88cacbc898 Expose component constants for llm helper (#125891)
* Expose climate INTENT_GET_TEMPERATURE

* Expose conversation trace items

* More fixes for llm helper
2024-09-13 12:43:37 +02:00
Denis Shulyaka a85ccb94e3 LLM Tool parameters check (#123621)
* LLM Tool parameters check

* fix tests
2024-09-08 18:42:51 -07:00