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

Add forced function calling support in Vertex AI #12748

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

andrewheard
Copy link
Contributor

Implemented "forced" (formerly "constrained") function calling (see ToolConfig for details). This is a port of google-gemini/generative-ai-swift#124.

Testing in Function Calling Sample + Gemini 1.5 Pro:

  • AUTO default behaviour (no changes)
  • NONE disables function calls ("Unfortunately, I don't have access to real-time exchange rates...")
  • ANY
    • allowedFunctionNames: nil - no function calls allowed, same as NONE
    • allowedFunctionNames: ["get_exchange_rate"] - only returns function calls, no text

#no-changelog

@andrewheard andrewheard requested a review from paulb777 April 10, 2024 22:50
@andrewheard andrewheard merged commit 29c2248 into vertex-ai Apr 11, 2024
42 checks passed
@andrewheard andrewheard deleted the ah/vertex-ai-forced-func branch April 11, 2024 00:46
@firebase firebase locked and limited conversation to collaborators May 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants