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

Forced function calling #124

Merged
merged 6 commits into from
Apr 3, 2024
Merged

Forced function calling #124

merged 6 commits into from
Apr 3, 2024

Conversation

paulb777
Copy link
Collaborator

@paulb777 paulb777 commented Apr 3, 2024

Implement "forced" (formerly "constrained") function calling

Confirmed the three parameters (ANY, AUTO, NONE) return successfully in the CLI app and NONE disables the function call.

Open Questions:

  • Should no parameter be empty instead of "AUTO"?
  • If yes, what's the best way to implement?
  • What additional testing should be done?

@paulb777 paulb777 marked this pull request as draft April 3, 2024 00:07
@github-actions github-actions bot added component:swift sdk Issue/PR related to Swift SDK status:awaiting review PR awaiting review from a maintainer labels Apr 3, 2024
@paulb777 paulb777 changed the title Constrained function calling Forced function calling Apr 3, 2024
@paulb777 paulb777 requested a review from andrewheard April 3, 2024 18:58
@paulb777 paulb777 marked this pull request as ready for review April 3, 2024 18:59
Sources/GoogleAI/GenerativeModel.swift Outdated Show resolved Hide resolved
Sources/GoogleAI/FunctionCalling.swift Outdated Show resolved Hide resolved
@paulb777
Copy link
Collaborator Author

paulb777 commented Apr 3, 2024

Agree that nesting is better. Done.

Copy link
Collaborator

@andrewheard andrewheard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (please revert Examples/GenerativeAICLI/Sources/GenerateContent.swift before merging though)

@paulb777 paulb777 merged commit 016b555 into main Apr 3, 2024
8 checks passed
@paulb777 paulb777 deleted the pb-constrained branch April 3, 2024 19:45
@github-actions github-actions bot removed the status:awaiting review PR awaiting review from a maintainer label Apr 3, 2024
SsomsakTH pushed a commit to SsomsakTH/generative-ai-swift that referenced this pull request Jun 21, 2024
SsomsakTH pushed a commit to SsomsakTH/generative-ai-swift that referenced this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:swift sdk Issue/PR related to Swift SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants