Hi all, I have a question pertaining to the thread name. I would like to use Gemini 1.5 Pro to essentially give me an answer similar to that produced when the same query is passed manually into Google Search. I tested this using a scientific question, and the AI overview from a manual search gave the correct answer, while the API gave me the wrong answer. Is there a way to obtain this AI overview either through Gemini's 1.5 Pro or another API method?
#Reproducing Google's "AI Overview" in Gemini
1 messages · Page 1 of 1 (latest)
Did you use the Google Search Retrieval tool?
Nope is that in the Gemini API? Sorry I’m not familiar with this tool
Anyhoo I’ll look into this tmrw morning. Thanks for the tip!
Yes, it is available in the Gemini API.
See https://ai.google.dev/gemini-api/docs/grounding (tho it has changed slightly for Gemini 2.0, it still exists.)
Thanks for introducing me to Grounding. This seems like it should be exactly what I'm looking for. I used their code snippet in Co-Lab but I get TooManyRequests: 429 POST https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-002:generateContent?%24alt=json%3Benum-encoding%3Dint: Resource has been exhausted (e.g. check quota). as an error. Interestingly, if I simply omit the tools='google_search_retrieval' argument, thus performing a standard prompt request withing Grounding, it works fine.
Are you using a free API Key or one attached to a billing account?
Free API key
Search grounding under 1.5 may require a paid key.
Under 2.0 it may be free for now.
Oh I just switched to a paid key. Confirming it works for 1.5. I wasn’t sure if 2.0 can be accessed as a model in my account and didn’t try
Thanks for these tips. All very helpful
Glad they've helped!
I’m a bit hesitant to scale up on this. I plan to run about 8k requests of this nature. Waiting on the bill account overview to update so that I can see how much an individual search costs 😅