-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Image generation ai agent #7156
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?
Conversation
|
@linznin please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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 Sentry. 🚀 New features to boost your workflow:
|
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