Commit Graph

108 Commits (area-motion-entity-id)

Author SHA1 Message Date
Ivan Lopez Hernandez 0edfbded23
Fixes #140182 by checking file status before sending the prompt. (#144131)
* Added unit tests

* Addressed review comments

* Fixed tests

* PR comments
2025-05-05 23:45:39 -07:00
Allen Porter 2326c23133
Increase Gemini max tokens to avoid failures observed in evaluations (#143728)
* Increase Gemini max tokens to avoid failures observed in evaluations

* Update snapshots
2025-04-26 15:30:47 -07:00
Marc Mueller 3cf12a4792
Replace unnecessary MappingProxyType annotations in integrations (#143451) 2025-04-22 18:14:32 +02:00
Allen Porter 4483025856
Update Google Generative AI to allow multiple LLM APIs (#143191) 2025-04-19 11:44:12 +02:00
tronikos ff8b96a19f
Fix range of Google Generative AI temperature (#142513) 2025-04-08 20:46:09 +02:00
Ivan Lopez Hernandez c14380247b
Handle None on the response candidates in Google Generative AI (#142497)
* Added type checking on the candidates list

* Made error message a constant
2025-04-07 21:20:54 -07:00
tronikos 051a503047
Add a description for the enable_google_search_tool option in Google AI (#142322)
* Add a description for the enable_google_search_tool option in Google AI

* Use quotes
2025-04-05 20:49:38 +02:00
Ivan Lopez Hernandez 30e50d261d
Made Google Search enable dependent on Assist availability (#141712)
* Made Google Search enable dependent on Assist availability

* Show error instead of rendering again

* Cleanup test code
2025-04-03 16:23:59 -04:00
Paulus Schoutsen e88b321741
Ensure user always has first turn for Google Gen AI (#141893) 2025-03-30 23:31:45 -04:00
Erik Montnemery 373cca9857
Remove unused mypy ignore from google_generative_ai_conversation (#141549) 2025-03-27 10:03:07 +01:00
Ivan Lopez Hernandez 4f318c0be3
Initialize google.genai.Client in the executor (#141432)
* Intialize the client on an executor thread

* Fix MyPy error

* MyPy error

* Exception error

* Fix ruff

* Update __init__.py

---------

Co-authored-by: tronikos <tronikos@users.noreply.github.com>
2025-03-26 22:05:22 -07:00
Ivan Lopez Hernandez 56cc4044e4
Fix a type error when using google-genai==1.7.0 (#141431)
* Fix parts

* Fix the type being sent to the SDK

* Revert changes to __init__

* Test fixes

* Bump version back to 1.7
2025-03-25 19:59:21 -07:00
SLaks c8f839068c
Bump google-genai to 1.7.0 (#140770)
Gemini: Upgrade google-genai to support generating images
2025-03-24 10:52:16 -07:00
Mirko Liebender d3b8dbb76c
Google gen ai fix for empty chat log messages (#136019) (#140315)
* Google gen ai fix for empty chat log messages (#136019)

* Google gen ai test for empty chat history fields (#136019)
2025-03-23 22:27:35 -07:00
Ivan Lopez Hernandez 6a7fa3769d
Add Google Search tool in Google Generative AI (#140772)
* Added Google Search grounding

* Added testing
2025-03-23 22:23:52 -07:00
Allen Porter f14b76c54b
Add Gemini/OpenAI token stats to the conversation trace (#141118)
* Add gemini token status to the conversation trace

* Add OpenAI Token Stats

* Revert input_tokens_details since its not in the openai version yet

* Fix ruff lint errors
2025-03-23 12:03:06 -04:00
Ivan Lopez Hernandez d9cf2750d5
Ensure file is correctly uploaded by the GenAI SDK (#140969)
Opened the file outside of the SDK
2025-03-19 22:58:19 -07:00
Ivan Lopez Hernandez 110e827ede
Add @IvanLH to owners of google_generative_ai_conversation (#140764)
Update CODEOWNERS
2025-03-17 09:12:22 +01:00
Denis Shulyaka 056616f9c5
Stronger type annotations for conversation content (#140725)
stronger type annotations for conversation content
2025-03-16 10:59:25 -04:00
Franck Nijhof d309239bcc
Fix typo in Google Generative AI conversation: intead -> instead (#140398) 2025-03-11 10:18:34 -07:00
Luke Lashley 8fe45fb994
Fix todo tool broken with Gemini 2.0 models. (#140246)
* Change tool name for addlist item

* Change to HasListAddItem

* extract to function
2025-03-10 14:02:07 -07:00
Paulus Schoutsen 49a62d5294
Standardize conversation.async_process method (#140125) 2025-03-10 14:15:10 -05:00
Paulus Schoutsen d47481a30e
Track when an LLM expects to continue a conversation (#139810)
* Track when an LLM expects to continue a conversation

* Strip content

* Address comments
2025-03-06 22:52:29 -05:00
Ivan Lopez Hernandez 2aa584ce39
Correctly retrieve only loaded Google Generative AI config_entries (#139999)
* Correctly retrieve only loaded config_entries

* Ruff
2025-03-06 13:17:33 -08:00
Ivan Lopez Hernandez 8e35783164
Trim the Schema allowed keys to match the Public Gemini API docs. (#139876)
* Trim the Schema allowed types to match the Public API docs, not the SDK types as those do not match

* Testing
2025-03-05 18:34:11 -08:00
Ivan Lopez Hernandez 4e8186491c
Fix Gemini Schema validation for #139416 (#139478)
Fixed Schema validation for issue #139477
2025-02-27 19:10:42 -08:00
SLaks 580c6f2684
Allow arbitrary Gemini attachments (#138751)
* Gemini: Allow arbitrary attachments

This lets me use Gemini to extract information from PDFs, HTML, or other files.

* Gemini: Only add deprecation warning when deprecated parameter has a value

* Gemini: Use Files.upload() for both images and other files

This simplifies the code.

Within the Google client, this takes a different codepath (it uploads images as a file instead of re-saving them into inline bytes).  I think that's a feature (it's probably more efficient?).

* Gemini: Deduplicate filenames
2025-02-23 16:11:38 -08:00
Ivan Lopez Hernandez 3160b7baa0
Swap the Gemini SDK to the newly released Unified SDK (#138246)
* Swapped the old GenAI client with the newly realeased one

* Fixed the Generate Content Action, Config Flow loading and code cleanup

* Add a function to mask the issues with Tools which start with Hass

* Fix most tests

* google-genai==1.1.0

* fixes

* Fixed the remaining tests

* Adressed comments

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: tronikos <tronikos@users.noreply.github.com>
2025-02-21 22:41:05 -08:00
Erik Montnemery f83c8de8d3
Update signature of platforms' async_setup_entry (#138201) 2025-02-10 21:08:03 +01:00
Paulus Schoutsen 7883106e7c
Make sure we always have agent_id in ConversationInput (#137679)
* Make sure we always have agent_id in ConversationInput

* fix type
2025-02-07 18:25:21 -08:00
Paulus Schoutsen 3b871afcc4
Update default Google model to Gemini Flash 2.0 (#137505) 2025-02-05 23:27:13 -05: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
Paulus Schoutsen dd9bd8ef73
Make get_chat_session a callback context manager (#137146) 2025-02-01 23:37:24 -05:00
Paulus Schoutsen 2f6640707b
Extract conversation ID generation to helper (#137062)
* Extract conversation ID generation to helper

* Allow nested get_chat_log calls
2025-02-01 20:54:00 -05:00
Paulus Schoutsen 8ab6bec746
Migrate Google Gen AI to ChatSession (#136779)
* Migrate Google Gen AI to ChatSession

* Remove unused method
2025-01-29 10:42:39 -05:00
epenet b11b36b523
Add more util aliases to import conventions (#136153) 2025-01-21 15:58:23 +01:00
tronikos f1ad3040b8
Allow automations to pass any conversation_id for Google Generative AI (#134251) 2024-12-31 15:52:29 -05:00
Joost Lekkerkerker e6225e3dcc
Drop current quality scale (#131072) 2024-11-20 20:54:15 +01:00
epenet 6d561a9796
Remove deprecated property setters in option flows (#129773) 2024-11-04 14:21:26 +01:00
epenet 536d702d96
Use reauth helpers in google_generative_ai_conversation (#128583) 2024-10-17 10:19:24 -07:00
J. Nick Koston 242a3c6616
Bump google-generativeai to 0.8.2 (#126696)
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 (#124940)
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 (#124769) 2024-08-28 13:47:41 +02:00
Paulus Schoutsen aa6f0cd55a
Add CONTROL supported feature to Google conversation when API access (#123046)
* 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 (#123069) 2024-08-02 23:14:24 -07: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 975cfa6457
Fix gemini api format conversion (#122403)
* 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 (#122348)
* Ignore format for string tool args

* Add tests
2024-07-21 21:54:31 -07:00
tronikos 5ce54c2174
Replace GoogleAPICallError with GoogleAPIError (#120902) 2024-07-01 17:48:12 +02:00
tronikos d2a457c24f
Fix Google Generative AI: 400 Request contains an invalid argument (#120741) 2024-06-28 13:25:55 +02:00