Implement "grounding" feature for Google Generative AI (Gemini)

Hey there,

this feature request is related to the Google Generative AI Integration (Google Generative AI - Home Assistant).

Right now I’m trying to fully switch from Google Assistant/Nest to HomeAssistant as Voice Assistants. But one key feature is missing in my opinion: being able to ask questions about current or future events and information on the web in general.
E.g. when’s the next election for xyz or something like that.

I’ve tested a few things with different AI and the only thing that is able to produce accurate results for this is (who would have thought) Google.
Using it’s Gemini AI you can turn on “Grounding” as a feature so that it’s fact checking with a web search.

As far as I am aware, you can also use this feature in API Requests as a tool:

The “dynamic_threshold” should also be configurable in my opinion, since the use of grounding could get pretty expensive.

Can you add this to the official Google Generative AI Integration?

Either as a configurable model option, or to use as a own manual request to the API, so we can use it in scripts as tools for assist?

If I overlooked something or you have better solutions, please let me know.
That would be a gamechanger for using AI in combination with assist in my opinion!

Edit: for anyone wondering: yeah, ChatGPT (and most likely others) also has this feature, but only the App itself - not the OpenAI API.

Just added my vote!

Gemini 2.0 Flash has 500 free Google searches per month, more than enough for assist to use probably: Gemini Developer API Pricing  |  Gemini API  |  Google AI for Developers

In case anyone is interested in my current workaround:
I’m using ChatGPT as assist agent and created a script which calls a Perplexity API Request (Initial Setup - Perplexity) via RESTful Command - Home Assistant. Then i configured the context of my assist to always use this script if current / upcoming information is requested or the knowledge could be outdated. This is somewhat solid, but still a workaround and I think an out-of-the-box solution like Gemini with Grounding would result in better responses.