Commit Graph

55 Commits (60774575c651c2bd3422eccf4b4b8f486b18d376)

Author SHA1 Message Date
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 Lekkerkerker 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
Denis Shulyaka ed6d6575d7
Add aliases to script llm tool description (#122380)
* Add aliases to script llm tool description

* Also add name
2024-08-02 08:05:06 +02:00
Allen Porter 8d0e998e54
Improve conversation agent tracing to help with eval and data collection (#122542) 2024-07-31 14:38:44 +02:00
Denis Shulyaka be24475cee
Update selector converters for llm script tools (#122830) 2024-07-30 08:24:03 -07:00
Allen Porter e5bb1b2cc6
Update LLM prompt to improve quality for local LLMs (#122746) 2024-07-29 12:04:23 +02:00
Denis Shulyaka 064d7261b4
Ensure script llm tool name does not start with a digit (#122349)
* Ensure script tool name does not start with a digit

* Fix test name
2024-07-22 11:11:09 +02:00
Michael Hansen 417abda649
Add HassGetCurrentDate and HassGetCurrentTime intents (#121707) 2024-07-11 00:17:04 +02:00
Alan 8ff4991f07
LLM to handle int attributes (#121037) 2024-07-06 11:41:18 +02:00
Michael Hansen d3ceaef098
Allow timer management from any device (#120440) 2024-06-26 09:06:56 +02:00
Marc Mueller 49df0c4366
Improve schema typing (2) (#120475) 2024-06-26 02:25:30 +02:00
Denis Shulyaka 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 <mike@rhasspy.org>
2024-06-25 10:43:26 -05:00
Paulus Schoutsen 5c2db162c4
Remove "no API" prompt (#120280) 2024-06-24 08:57:59 +02:00
Paulus Schoutsen 19f97a3e53
LLM to handle decimal attributes (#120257) 2024-06-23 17:09:57 -04:00
tronikos ad1f0db5a4
Pass prompt as system_instruction for Gemini 1.5 models (#120147) 2024-06-22 12:35:48 +02:00
Paulus Schoutsen c49ca5ed56
Ensure intent tools have safe names (#119144) 2024-06-08 17:53:47 +02:00
Paulus Schoutsen 52ad90a68d
Include script description in LLM exposed entities (#118749)
* Include script description in LLM exposed entities

* Fix race in test

* Fix type

* Expose script

* Remove fields
2024-06-04 11:18:07 -04:00
tronikos f9dff1632e
Use ISO format when passing date to LLMs (#118705) 2024-06-03 19:48:50 +02:00
Paulus Schoutsen bdcfd93129
Automatically fill in slots based on LLM context (#118619)
* Automatically fill in slots from LLM context

* Add tests

* Apply suggestions from code review

Co-authored-by: Allen Porter <allen@thebends.org>

---------

Co-authored-by: Allen Porter <allen@thebends.org>
2024-06-03 10:36:41 -04:00
Paulus Schoutsen f3b20d30ae
Add base prompt for LLMs (#118592) 2024-06-01 00:21:37 -04:00
tronikos dfb407728f
Stop instructing LLM to not pass the domain as a list (#118590) 2024-05-31 20:21:18 -04:00
Paulus Schoutsen 6dd01dbff7
Rename llm.ToolContext to llm.LLMContext (#118566) 2024-05-31 11:11:24 -04:00
tronikos 2bd142d3a6
Improve LLM prompt (#118520) 2024-05-30 22:03:57 -04:00
tronikos 272c51fb38
Fix unnecessary single quotes escaping in Google AI (#118522) 2024-05-30 19:56:06 -04:00
tronikos 0d6c7d0973
Fix LLMs asking which area when there is only one device (#118518)
* Ignore deprecated open and close cover intents for LLMs

* Fix LLMs asking which area when there is only one device

* remove unrelated changed

* remove unrelated changes
2024-05-30 17:14:11 -04:00
tronikos 6d82cfa91a
Ignore deprecated open and close cover intents for LLMs (#118515) 2024-05-30 16:29:13 -04:00
Paulus Schoutsen 80588d9c67
Ignore the toggle intent (#118491) 2024-05-30 12:53:50 -04:00
tronikos 4893faa671
Instruct LLM to not pass a list to the domain (#118451) 2024-05-30 08:37:45 +02:00
tronikos 639f6c640c
Improve LLM prompt (#118443)
* Improve LLM prompt

* test

* improvements

* improvements
2024-05-29 21:44:33 -04:00
tronikos 4056c4c2cc
Ask LLM to pass area name and domain (#118357) 2024-05-29 08:03:43 -04:00
tronikos c75cb08aae
Fix LLM tracing for Google Generative AI (#118359)
Fix LLM tracing for Gemini
2024-05-29 08:02:59 -04:00
tronikos b7ee90a53c
Expose useful media player attributes to LLMs (#118363) 2024-05-29 08:01:40 -04:00
Paulus Schoutsen d22871f1fd
Reduce the intent response data sent to LLMs (#118346)
* Reduce the intent response data sent to LLMs

* No longer delete speech
2024-05-28 23:07:00 -04:00
Paulus Schoutsen c097a05ed4
Tweak Assist LLM API prompt (#118343) 2024-05-28 22:43:22 -04:00
Paulus Schoutsen 615a1eda51
LLM Assist API to ignore intents if not needed for exposed entities or calling device (#118283)
* LLM Assist API to ignore timer intents if device doesn't support it

* Refactor to use API instances

* Extract ToolContext class

* Limit exposed intents based on exposed entities
2024-05-28 21:29:18 -04:00
Paulus Schoutsen f0d7f48930
Handle generic commands as area commands in the LLM Assist API (#118276)
* Handle generic commands as area commands in the LLM Assist API

* Add word area
2024-05-28 11:21:17 -04:00
Paulus Schoutsen 6f248acfd5
LLM Assist API: Inline all exposed entities (#118273)
Inline all exposed entities
2024-05-27 21:12:10 -04:00
Paulus Schoutsen ecb05989ca
Add exposed entities to the Assist LLM API prompt (#118203)
* Add exposed entities to the Assist LLM API prompt

* Check expose entities in Google test

* Copy Google default prompt test cases to LLM tests
2024-05-27 00:27:08 -04:00
Paulus Schoutsen 1602c8063c
Standardize LLM instructions prompt (#118195)
* Standardize instructions prompt

* Add time/date to default instructions
2024-05-26 20:24:26 -04:00
Paulus Schoutsen 233c3bb2be
Add render prompt method when no API selected (#118136) 2024-05-26 13:35:15 +02:00
Denis Shulyaka cee3be5f7a
Break long strings in LLM tools (#118114)
* Break long code strings

* Address comments

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-25 14:24:51 -04:00
Allen Porter 89e2c57da6
Add conversation agent debug tracing (#118124)
* Add debug tracing for conversation agents

* Minor cleanup
2024-05-25 14:16:51 -04:00
Denis Shulyaka da74ac06d7
Add user name and location to the LLM assist prompt (#118071)
Add user name and location to the llm assist prompt
2024-05-24 22:23:05 -04:00
Paulus Schoutsen 7554ca9460
Allow llm API to render dynamic template prompt (#118055)
* Allow llm API to render dynamic template prompt

* Make rendering api prompt async so it can become a RAG

* Fix test
2024-05-24 16:04:48 -04:00
Paulus Schoutsen 1f7245ecf2
Update LLM no tools message (#117935) 2024-05-22 21:17:03 -04:00
Denis Shulyaka 009c9e79ae
LLM Tools: Add device_id (#117884) 2024-05-21 21:24:46 -04:00