Would it be possible to add the “grounding” option to the Gemini 2 AI Model?
If you check AI studio you will find there are missing options not available on n8n while on AI studio is available , & ChatGPT has all sort of functions!
Just checked n8n v1.73.1 and unfortunately, the installed version of @langchain/google-genai (=1.14) is just a few versions behind for Google’s grounding support. It should work once this is upgraded to v1.16 though official node support is another story.
Workaround would be to use the HTTP node like so… though I suspect you already knew that!
If you’re self-hosting, you can try using the Langchain code node once n8n is updated with @langchain/google-genai v1.16 or higher. Note - the following isn’t supposed to work at time of writing!
To expand on your answer, the gemini-2.0-flash-exp model does not seem to support anything beyond a simple tool description. It worked, but you are not able to specify thresholds or mode. So for the flash 2 exp, you have to use this simplified syntax for the JSON when using CURL/HTTP request:
Thank you for that helpful workaround!
I hope we’ll see official support for this functionality soon.
It would be great to have Gemini fully integrated like we do with the ChatGPT API, that would really streamline things