Skip to content
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 cookbook does not adequately explain how function calling works #92

Closed
NickEfthymiou opened this issue Apr 23, 2024 · 1 comment
Labels
component:quickstarts Issues/PR referencing quickstarts folder status:triaged Issue/PR triaged to the corresponding sub-team type:bug Something isn't working

Comments

@NickEfthymiou
Copy link

NickEfthymiou commented Apr 23, 2024

The documentation and the function calling cookbook examples confer the impression that the model will use one of the tool functions supplied by the client in the function_declarations array. In fact, the model predicts a tool function and is in no way constrained to use the tools listed.
Consider the following request (used in v1beta, gemini-pro)
Model request.json
It generated response like this (Headers and response body)
BadFunctionResponse2.txt
BadFunctionResponse2.json

The actual name of the functionCall the model will predict varies. This is another model response to that same identical model request
BadFunctionResponse3.json

The cookbook should, in my opinion, clarify that the function declaration section is not like a traditional software interface with strictly defined operations that specify a contract. The interface is open ended, with the model predicting useful tool functions it considers should be there.

@singhniraj08 singhniraj08 added type:bug Something isn't working status:triaged Issue/PR triaged to the corresponding sub-team component:quickstarts Issues/PR referencing quickstarts folder labels Apr 24, 2024
@markmcd
Copy link
Member

markmcd commented Aug 27, 2024

I think the model is a lot better than it was at first launch at honoring your intent, and we now have a recipe showing how to use t he function_calling_config arg too: https://github.com/google-gemini/cookbook/blob/main/quickstarts/Function_calling_config.ipynb

Feel free to reopen if you think there's more we can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:quickstarts Issues/PR referencing quickstarts folder status:triaged Issue/PR triaged to the corresponding sub-team type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants