-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Error Invalid Argument when use more than one tools in GenerativeModel class #636
Comments
As far as I can tell in my own testing and usage, the |
I apologize for the late reply. Perhaps, could you please provide the best practive to build the calling function for grounding call? Anyway, Thank you very much for your insight. It means a lot to me. More or less, I can see how to implement your solution to my application. =D |
Got it. Sure thing, let me reopen this and come up with a better way for us to document using the grounding tool alongside functions-as-tools. Thanks for opening this! |
Thank you for reopening the issue! Looking forward to the improved documentation on using the grounding tool alongside functions-as-tools. |
Hi @yamazakikakuyo. Unfortunately I was not able to find a good way to solve this and use both Tools at the same time, nor was I able to decompose the underlying The current way of using both Tools is to either 1) make a Gemini API call with the grounding tool, then make subsequent Gemini API calls with a Tool that refers to one or more functions, or 2) craft a new In the meantime, please open a feature request on the Vertex AI issue tracker since this seems like a solid use case to me of combining different Tool specs or Tools with Gemini API calls. |
Hi @koverholt, Thank you for your detailed response and the suggestions provided. I understand the current limitations and the workarounds you mentioned for using both Tools simultaneously. I have opened feature request on the Vertex AI issue tracker to highlight this use case of combining different Tool specs or Tools with Gemini API calls. I hope I could contribute on Gemini development. Nevertheless, your input has been very helpful, and I appreciate your guidance on this matter. Best Regards. |
Thank you for opening that feature request, we really appreciate it! Linking it here for future reference: |
Update - It is possible to use multiple tools with Gemini 2.0 Flash. You can see how to do this in https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/getting-started/intro_gemini_2_0_flash.ipynb |
File Name
Using Vertex Search (a.k.a Agent Builder) and Calling Function
What happened?
Hi, I have an issue when using more than one Tool class in GenerativeModel class. Long short story, I tried to make a Gemini chatbot that capable to use Grounding (with Agent Builder) and Callign Function, so Gemini chatbot could maximize its potential. I read the documentation of GenerativeModel class in this link and it said that the tools parameter could take more than one Tool class. Here's the code I used:
However, when I sent a simple sentence to chatbot mode (with codes below), it give an error of invalid argument, but when I only use one Tool class as tools parameter, there's no error and run smoothly. I have assigned the error in Relevant Log Output section.
Detail of environment and library:
google-cloud-aiplatform
library : 1.48.0vertexai
library : 1.48.0I hope you could give me a solution or insight for this problem. Thank a lot beforehand! =D
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: