Skip to content

Python: support ChatKit structured input conversion - #8843

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

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

Conversation

@quifox

Copy link
Copy Markdown

Motivation & Context

agent-framework-chatkit recognizes StructuredInputItem, but the converter currently drops it with return []. This means structured input status and user answers are missing when ChatKit thread history is converted back into model input.

Description & Review Guide

  • What are the major changes? Convert StructuredInputItem into a user Message that preserves the overall status and represents each question as answered, skipped, or unanswered. Add focused coverage for multiple answers, skipped answers, unanswered questions, and dispatch ordering.
  • What is the impact of these changes? Structured input interactions remain available to the agent on later turns instead of being silently discarded. The conversion mirrors the default openai-chatkit behavior and stays inside the ChatKit adapter.
  • What do you want reviewers to focus on? The mapping intentionally preserves the existing ChatKit semantics without adding a new public API.

Related Issue

Fixes #8841

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 documented behavior and includes focused coverage for the supported states.

Review effort: Balanced
Findings: None

What changed in this PR

Adds ChatKit structured-input conversion so prior statuses and answers remain available as user context.

Changes:

  • Converts answered, skipped, and unanswered structured inputs into a user message.
  • Adds focused conversion and dispatch-order tests.
File Description
python/​packages/​chatkit/​agent_framework_chatkit/​_converter.py Implements structured-input conversion and dispatch.
python/​packages/​chatkit/​tests/​test_converter.py Covers conversion semantics and ordering.

💡 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 — 25c66187 Deployed Sep 29, 2026 by quifox via team_check #5514
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 structured input conversion

2 participants