-
Notifications
You must be signed in to change notification settings - Fork 121
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
Function calling only considers functions in the first tool? #194
Comments
…ogle-gemini/generative-ai-dart#194 Introducing getFunctionDeclarations, may replace getTool
Correction: this is with Gemini 1.5 Flash, I'll experiment with Pro again, possibly file another issue (cannot deal with more than 8 functions) |
Something which could affect this bug: while I was converting over the code to use https://pub.dev/packages/firebase_vertexai I got the error |
I am looking for the right way to load a function calling with Flutter/Dart. I have done it as follows: In a nutshell, am I doing the configurations wrong, or is something missing in this API for function calling? 🤔 I am using this package google_generative_ai. Option One
Option Two
|
Description of the bug:
Using
gemini-1.5-flash
.Prompt: "What is the weather today?"
Tool configuration 1:
Response 1:
I need to know your location to get the weather forecast. Can you tell me your latitude and longitude?
Tool configuration 2 (switching the order of the two tools):
Response 2:
I am sorry, I cannot fulfill this request. I do not have access to weather information.
Artificially unifying the two tools into a virtual one, merging all functions under that:
The model properly asks first for the location tool for the lat / lon coordinates, and then with a second round of call (where I pass the location function call result down) it properly asks to call the weather function with the proper GPS coordinates.
Respnose:
The weather today is clear and the temperature is 25 degrees Celsius. The wind is blowing from the southwest at 2 meters per second.
Actual vs expected behavior:
I'd expect to be able to keep the two tools apart for extensible software architecture. So far I'm aiming for 8 tools, many of those have multiple functions.
Any other information you'd like to share?
I peeked at the code and it looks to me that ultimately a REST API call is made. The
_generateContentRequest
seems to serialize the tools OK (by looking at it)if (tools != null) 'tools': tools.map((t) => t.toJson()).toList(),
generative-ai-dart/pkgs/google_generative_ai/lib/src/model.dart
Line 333 in 8a58d77
The text was updated successfully, but these errors were encountered: