Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Why am I getting "Search Grounding is not available in your country" error with Google Generative AI

Hi everyone,

I'm trying to use the Google Generative AI Node.js library for a project and encountered this error when running the search_grounding.js sample code:


file:///Users/theo.despoudis/workspace/Generative-AI-Web-Apps/ch07/summarization-examples/node_modules/@google/generative-ai/dist/index.mjs:412
throw new GoogleGenerativeAIFetchError(`Error fetching from ${url.toString()}: [${response.status} ${response.statusText}] ${message}`, response.status, response.statusText, errorDetails);
^

GoogleGenerativeAIFetchError: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent: [400 Bad Request] Search Grounding is not available in your country.

I'm using this code example from GitHub:
search_grounding.js

I live in Ireland, and it seems like the feature (Search Grounding) isn't available in my region

Is there a way to work with the Search Grounding feature from Ireland?
Are there any workarounds, like a specific configuration, or alternative APIs I could use to achieve the same functionality?

Thanks! 😊

0 REPLIES 0