I tried to run the example code from this URL Grounding with Google Search | Gemini API | Google AI for Developers
import {
DynamicRetrievalMode,
GoogleGenerativeAI,
} from "@google/generative-ai";
const genAI = new GoogleGenerativeAI(process.env.API_KEY);
const model = genAI.getGenerativeModel(
{
model: "models/gemini-1.5-pro-002",
tools: [
{
googleSearchRetrieval: {
dynamicRetrievalConfig: {
mode: DynamicRetrievalMode.MODE_DYNAMIC,
dynamicThreshold: 0.7,
},
},
},
],
},
{ apiVersion: "v1beta" },
);
const prompt = "Who won Wimbledon this year?";
const result = await model.generateContent(prompt);
console.log(result.response.candidates[0].groundingMetadata);
I always receive an 429 “Too many requests” error. Without grounding I receive answers.
Is grounding restricted to countries and/ or paid/unpaid plans?