-
Notifications
You must be signed in to change notification settings - Fork 4.3k
.Net: Support Support BinaryContent in Gemini Connector #13140
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
base: main
Are you sure you want to change the base?
.Net: Support Support BinaryContent in Gemini Connector #13140
Conversation
@microsoft-github-policy-service agree |
@Millmer please can you also add one integration test for this change, I'm happy to run that on my side and if all ok, happy to validate and merge the change. Thanks for the contribution! |
That's done @rogerbarreto, let me know if there is anything else 😄 Thanks! |
dotnet/src/Connectors/Connectors.Google/Core/Gemini/Models/GeminiRequest.cs
Show resolved
Hide resolved
@rogerbarreto Any idea on when this might get in? We would like to make use of this in our project. At the moment we're having to do a conditional check just for Gemini and pass file inputs in a different way. It would be nice to have the same interface regardless of the chosen model. |
Motivation and Context
Resolves: #13131
Description
The Gemini connector actually already supports arbitrary base64 PDF content by prioritising binary data in the
CreateGeminiPartFromImage
function in theGeminiRequest.cs
.I kept the current behaviour with the
ImageContent
andAudioContent
but also added explicit support for theBinaryContent
KernelContent type in theGetGeminiPartFromKernelContent
function to bring it inline with how the other connectors work.I applied the same Chat Completion Unit test as those I found in the OpenAI Connector for BinaryContent.
Contribution Checklist