-
Notifications
You must be signed in to change notification settings - Fork 4.4k
.Net: Feature/gemini function parts format #13258
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
.Net: Feature/gemini function parts format #13258
Conversation
|
@microsoft-github-policy-service agree company="Kroll" |
|
@abbottdev Thank you for the contribution! Can as part of this change you also add an A simple example similar to the ones we have in the GettingStarted using Time and Weather could suffice to validate the double function calling updates do work directly with API calls. Thanks! |
|
Apologies @rogerbarreto I've been on annual leave for the last 2 weeks! |
Motivation and Context
It appears that there's a quirk to how Gemini handles tool call results in it's API. The tool responses need to be present in the same chat item as the tool requests - rather than adding them individually as separate chat history items.
This appears to fix (at least in my use case) the error whereby you receive:
-->
Description
Google Gemini expects the function responses to be grouped together in a single message rather than split across multiple separate messages with role "function". By adding a batch tool result overload to the GeminiChatMessage we can correctly parse the multiple parts of the function call into their respective function parts.
Contribution Checklist
FYI @stephentoub (As I see you're working in the Gemini connector recently)