autogen-ext: Support Image generation message on ai agent#7156
Open
linznin wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7156 +/- ##
==========================================
- Coverage 81.22% 81.18% -0.04%
==========================================
Files 244 244
Lines 18512 18525 +13
==========================================
+ Hits 15036 15040 +4
- Misses 3476 3485 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
adyanrehman5-lab
approved these changes
Dec 30, 2025
adyanrehman5-lab
approved these changes
Dec 30, 2025
Contributor
Author
|
@microsoft-github-policy-service agree |
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?
This PR adds support for handling image generation results returned via the OpenAI Responses API in the
OpenAIagent message stream.Previously, the agent primarily relied on
response_obj.output_text(or a fallback placeholder) and would therefore miss non-text outputs contained inresponse_obj.output, such as image generation tool calls. As a result, image-generation-capable models/tools could successfully generate images, but the agent would not surface them to downstream consumers (and message history would not reflect them).With this change, the agent:
response_obj.outputwhen present.ImageGenerationCallresults (base64) intoAddImageitems so downstream UIs/clients can render images.ResponseOutputMessageparts and returnsTextMessagewhen output is purely textual.MultiModalMessagewhen the output includes non-string content (e.g., images), while preserving message history semantics.This enables image generation responses to be delivered through the same streaming interface and message abstractions used by other modalities.
Related issue number
N/A
Checks