Commit Graph

68 Commits (70d4ee93f52094b16bbdcba1c68a2f234e214ca0)

Author SHA1 Message Date
J. Nick Koston 242a3c6616
Bump google-generativeai to 0.8.2 ()
changelog: https://github.com/google-gemini/generative-ai-python/compare/v0.7.2...v0.8.2
2024-09-24 15:13:12 -07:00
J. Nick Koston 8cafa1bcdf
Bump google-generativeai to 0.7.2 ()
changelog: https://github.com/google-gemini/generative-ai-python/compare/v0.6.0...v0.7.2
2024-08-30 22:33:26 +02:00
Erik Montnemery cffa8b4feb
Update icons.json to new service schema part 2 () 2024-08-28 13:47:41 +02:00
Paulus Schoutsen aa6f0cd55a
Add CONTROL supported feature to Google conversation when API access ()
* Add CONTROL supported feature to Google conversation when API access

* Better function name

* Handle entry update inline

* Reload instead of update
2024-08-02 23:16:30 -07:00
Denis Shulyaka f6ad018f8f
Change enum type to string for Google Generative AI Conversation () 2024-08-02 23:14:24 -07:00
Allen Porter 8d0e998e54
Improve conversation agent tracing to help with eval and data collection () 2024-07-31 14:38:44 +02:00
Denis Shulyaka 975cfa6457
Fix gemini api format conversion ()
* Fix gemini api format conversion

* add tests

* fix tests

* fix tests

* fix coverage
2024-07-22 17:56:13 -07:00
Denis Shulyaka ac1ad9680b
Goofle Generative AI: Fix string format ()
* Ignore format for string tool args

* Add tests
2024-07-21 21:54:31 -07:00
tronikos 5ce54c2174
Replace GoogleAPICallError with GoogleAPIError () 2024-07-01 17:48:12 +02:00
tronikos d2a457c24f
Fix Google Generative AI: 400 Request contains an invalid argument () 2024-06-28 13:25:55 +02:00
Denis Shulyaka 2386ed3830
Add script llm tool ()
* 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 () 2024-06-24 08:57:59 +02:00
tronikos ad1f0db5a4
Pass prompt as system_instruction for Gemini 1.5 models () 2024-06-22 12:35:48 +02:00
tronikos f605c10f42
Properly handle escaped unicode characters passed to tools in Google Generative AI () 2024-06-08 09:02:00 +02:00
tronikos 5fdfafd57f
Catch GoogleAPICallError in Google Generative AI () 2024-06-08 08:51:42 +02:00
tronikos ae59d0eadf
Bump google-generativeai to 0.6.0 () 2024-06-07 20:50:55 +02:00
Paulus Schoutsen 035e19be01
Google Gen AI: Copy messages to avoid changing the trace data () 2024-06-03 22:29:50 +02:00
tronikos a4612143e6
Use gemini-1.5-flash-latest in google_generative_ai_conversation.generate_content () 2024-05-31 21:57:14 -07:00
tronikos 7af469f81e
Strip Google AI text responses ()
* Strip Google AI test responses

* strip each part
2024-05-31 21:55:52 -07:00
Paulus Schoutsen f3b20d30ae
Add base prompt for LLMs () 2024-06-01 00:21:37 -04:00
Denis Shulyaka bae96e7d36
Add Google Generative AI Conversation system prompt `user_name` and `llm_context` variables ()
* Google Generative AI Conversation: Add variables to the system prompt

* User name and llm_context

* test for template variables

* test for template variables

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-31 15:28:44 -04:00
Paulus Schoutsen 6dd01dbff7
Rename llm.ToolContext to llm.LLMContext () 2024-05-31 11:11:24 -04:00
tronikos 272c51fb38
Fix unnecessary single quotes escaping in Google AI () 2024-05-30 19:56:06 -04:00
tronikos aeee222df4
Default to gemini-1.5-flash-latest in Google Generative AI ()
Default to flash
2024-05-29 08:04:47 -04:00
tronikos d83ab7bb04
Fix issue when you have multiple Google Generative AI config entries and you remove one of them () 2024-05-29 11:59:06 +02:00
Paulus Schoutsen 615a1eda51
LLM Assist API to ignore intents if not needed for exposed entities or calling device ()
* 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 0cf574dc42
Update the recommended model for Google Gen AI () 2024-05-28 21:21:28 -04:00
tronikos 63227f14ed
Add diagnostics to Google Generative AI ()
* Add diagnostics for Google Generative AI

* Remove quality scale from manifest

* include options in diagnostics
2024-05-28 00:02:32 -04:00
tronikos 0c245f1976
Fix freezing on HA startup when there are multiple Google Generative AI config entries ()
* Fix freezing on HA startup when there are multiple Google Generative AI config entries

* Add timeout to list_models
2024-05-27 23:49:16 -04:00
tronikos 722feb285b
Handle multiple function_call and text parts in Google Generative AI () 2024-05-27 19:57:03 -04:00
Paulus Schoutsen 1602c8063c
Standardize LLM instructions prompt ()
* Standardize instructions prompt

* Add time/date to default instructions
2024-05-26 20:24:26 -04:00
tronikos 0588806922
Promote Google Generative AI to platinum quality ()
* Promote Google Generative AI to platinum quality

* make exception for diagnostics
2024-05-26 17:07:31 -04:00
tronikos 0972b29510
Add Google Generative AI reauth flow ()
* Add reauth flow

* address comments
2024-05-26 11:44:48 -04:00
Paulus Schoutsen 233c3bb2be
Add render prompt method when no API selected () 2024-05-26 13:35:15 +02:00
Allen Porter 89e2c57da6
Add conversation agent debug tracing ()
* Add debug tracing for conversation agents

* Minor cleanup
2024-05-25 14:16:51 -04:00
tronikos 0182bfcc81
Google Generative AI: 100% test coverage for conversation ()
100% coverage for conversation
2024-05-25 07:52:20 -04:00
Paulus Schoutsen 81f3387d06
Flip prompts to put user prompt on top () 2024-05-25 00:33:24 -04:00
Paulus Schoutsen 69f237fa9e
Update Google safety defaults to match Google () 2024-05-25 00:02:53 -04:00
Paulus Schoutsen c59d4f9bba
Add no-API LLM prompt back to Google ()
* Add no-API LLM prompt back

* Use string join
2024-05-25 00:00:04 -04:00
Paulus Schoutsen 86a24cc3b9
Fix default Google AI prompt on initial setup () 2024-05-24 23:55:11 -04:00
Paulus Schoutsen 4b0f58ec63
Add device info to Google () 2024-05-24 22:23:25 -04:00
tronikos 620487fe75
Add Google Generative AI safety settings ()
* Add safety settings

* snapshot-update

* DROPDOWN

* fix test

* rename const

* Update const.py

* Update strings.json
2024-05-24 21:48:39 -04:00
tronikos 5ca27f5d0c
Google Generative AI: add timeout to ensure we don't block HA startup ()
* timeout

* fix

* tests
2024-05-24 21:31:02 -04:00
Paulus Schoutsen 7554ca9460
Allow llm API to render dynamic template prompt ()
* 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 d1af40f1eb
Google gen updates ()
* Add a recommended model for Google Gen AI

* Add recommended settings to Google Gen AI

* Revert no API msg

* Use correct default settings

* Make sure options are cleared when using recommended

* Update snapshots

* address comments
2024-05-23 17:16:48 -04:00
tronikos e4130480c3
Google Generative AI: Handle response with empty parts in generate_content ()
Handle response with empty parts in generate_content
2024-05-22 07:47:16 -07:00
Denis Shulyaka 2f0215b034
LLM Tools support for OpenAI integration ()
* initial commit

* Add tests

* Move tests to the correct file

* Fix exception type

* Undo change to default prompt

* Add intent dependency

* Move format_tool out of the class

* Fix tests

* coverage

* Adjust to new API

* Update strings

* Update tests

* Remove unrelated change

* Test referencing non-existing API

* Add test to verify no exception on tool conversion for Assist tools

* Bump voluptuous-openapi==0.0.4

* Add device_id to tool input

* Fix tests

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-21 22:45:04 -04:00
Denis Shulyaka 009c9e79ae
LLM Tools: Add device_id () 2024-05-21 21:24:46 -04:00
Paulus Schoutsen ff2b851683
Make Google AI model picker a dropdown () 2024-05-21 22:13:07 +02:00
Denis Shulyaka c3196a5667
LLM Tools support for Google Generative AI integration ()
* initial commit

* Undo prompt chenges

* Move format_tool out of the class

* Only catch HomeAssistantError and vol.Invalid

* Add config flow option

* Fix type

* Add translation

* Allow changing API access from options flow

* Allow model picking

* Remove allowing HASS Access in main flow

* Move model to the top in options flow

* Make prompt conditional based on API access

* convert only once to dict

* Reduce debug logging

* Update title

* re-order models

* Address comments

* Move things

* Update labels

* Add tool call tests

* coverage

* Use LLM APIs

* Fixes

* Address comments

* Reinstate the title to not break entity name

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-19 22:11:25 -04:00