Skip to content

Python: support ChatKit generated image conversion - #8844

Open
quick_fox (quifox) wants to merge 1 commit into
microsoft:mainfrom
quifox:feat/chatkit-generated-image
Open

quick_fox (quifox) wants to merge 1 commit into
microsoft:mainfrom
quifox:feat/chatkit-generated-image

Conversation

@quifox

Copy link
Copy Markdown

Motivation & Context

agent-framework-chatkit recognizes GeneratedImageItem, but the converter currently drops it with return []. This means generated images in ChatKit thread history are not provided back to the model on later turns.

Description & Review Guide

  • What are the major changes? Convert completed GeneratedImageItem instances into a user Message containing a short text preface and the generated image URI. Items without an image continue to be skipped. Add focused multimodal conversion coverage.
  • What is the impact of these changes? Generated images remain available as model context on later turns instead of being silently discarded. The conversion mirrors the default openai-chatkit behavior and uses Agent Framework Content.from_uri with the existing generic image/* media type pattern.
  • What do you want reviewers to focus on? The change is intentionally scoped to the existing ChatKit TODO and does not add a new public API.

Related Issue

Fixes #8842

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation matches the stated behavior and covers both conversion and missing-image handling.

Review effort: Balanced
Findings: None

What changed in this PR

Adds ChatKit generated images to subsequent model context.

Changes:

  • Converts completed generated images into multimodal user messages.
  • Continues skipping items without images.
  • Adds focused conversion and dispatch coverage.
File Description
python/​packages/​chatkit/​agent_framework_chatkit/​_converter.py Converts generated image URLs into image content.
python/​packages/​chatkit/​tests/​test_converter.py Verifies generated-image conversion behavior.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

This branch was successfully deployed

1 active deployment
github-app-auth — bb6b61d8 Deployed Sep 29, 2026 by quifox via team_check #5515
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Feature]: Support ChatKit generated image conversion

2 participants