PIL Image conversion issues with Gemini API Parts #5033
Labels
awaiting-op-response
Issue or pr has been triaged or responded to and is now awaiting a reply from the original poster
needs-triage
What happened?
I encountered type compatibility issues when trying to pass images to Gemini API. The images were converted into PIL Images, but not to
Part
, therefore causing issues.I created this conversion function (see below) that works for my use case and added it to
autogen/oai/gemini.py
. Just wanted to post it in case anyone needs it.What did you expect to happen?
Error message:
TypeError: Parameter to MergeFrom() must be instance of same class: expected Part got PIL.PngImagePlugin.PngImageFile.
How can we reproduce it (as minimally and precisely as possible)?
AutoGen version
0.4.1
Which package was this bug in
Core
Model used
gemini
Python version
No response
Operating system
No response
Any additional info you think would be helpful for fixing this bug
The text was updated successfully, but these errors were encountered: