Skip to content

Comments

Python: Fixed OpenAI image generation example#4056

Merged
dmytrostruk merged 1 commit intomicrosoft:mainfrom
dmytrostruk:sample-fixes-7
Feb 18, 2026
Merged

Python: Fixed OpenAI image generation example#4056
dmytrostruk merged 1 commit intomicrosoft:mainfrom
dmytrostruk:sample-fixes-7

Conversation

@dmytrostruk
Copy link
Member

No description provided.

@dmytrostruk dmytrostruk self-assigned this Feb 18, 2026
Copilot AI review requested due to automatic review settings February 18, 2026 23:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the OpenAI streaming image generation example to correctly handle partial images during generation. The previous code was checking for the wrong content type and accessing the wrong nested structure.

Changes:

  • Updated content type check from "uri" to "image_generation_tool_result" with proper nested Content handling
  • Changed access pattern to check content.outputs.type == "data" instead of content.type == "uri"
  • Added Content import from agent_framework

@dmytrostruk dmytrostruk added this pull request to the merge queue Feb 18, 2026
Merged via the queue into microsoft:main with commit 2dfe903 Feb 18, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants