🐛 [firebase_vertexai] Support google search retrieval grounding tool
Support google search retrieval grounding tool
Google released grounding with Google Search for the Gemini API. I'd like to be able to simply specify google_search_retrieval as the tool name when creating my GenerativeModel in order to be able to use it. Similar to how it's done in the API docs here:
model = genai.GenerativeModel('models/gemini-1.5-pro-002')
response = model.generate_content(contents="Who won Wimbledon this year?",
tools='google_search_retrieval')
print(response)
Right now, if I try to set it up, I need to do something like this:
final googleSearchGrounding = FunctionDeclaration(
'google_search_retrieval'
);
And pass it like this:
model = vertexAI.generativeModel(
tools: [Tool.functionDeclarations([googleSearchGrounding])],
But that's not working because FunctionDeclaration also expects parameters. I'd like to avoid having to declare a function declaration for it and just be able to pass the name google_search_retrieval directly somehow.
Hi! I commented this post that I'm sharing here because I guess the problem is related
https://github.com/google-gemini/generative-ai-dart/issues/222#issuecomment-2691065859
Anyway, I successfully performed a Google grounded request to Gemini 2.0 through Flutter with a little hardcoding as I mentioned in the linked post.
I would also love this feature! 👍