fix: support Gemini HEIC and HEIF image inputs - #3148
Merged
Merged
Conversation
Widening ImageMediaType let ImageInput(path="photo.heic") pass static checking, but the extension map still had no entry for .heic/.heif, so the call raised ValueError at runtime. Issue ag2ai#3147 calls this path out explicitly as the common case for a phone photo. Co-Authored-By: Claude Opus 5 <[email protected]>
marklysze
enabled auto-merge
August 11, 2026 05:17
Contributor
Author
|
@marklysze Thanks for the approval. The current head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
ImageInputaccepts Gemini-compatible HEIC and HEIF MIME types at runtime, butImageMediaTypeomits them from itsLiteralalias. That makes the publicImageInput(data=..., media_type=...)overload reject valid phone image formats during static checking. Add both MIME types and cover the public factory path in a regression test.Related issue number
Closes #3147
Checks
Local tests were not run because the local workspace has no available AG2 test environment and the filesystem volume is full. The added test uses the public API and asserts that both MIME types are present in the runtime alias; upstream CI is needed for final verification.
AI assistance
AI assistance was used to research issue #3147, draft the patch and regression test, and inspect the final diff. I reviewed the changes and will respond to maintainer feedback; the remaining validation checkbox is intentionally left open until CI runs.