Skip to content

Python: feat: Add ChatKit integration with a sample application - #1273

Merged
Evan Mattson (moonbox3) merged 42 commits into
microsoft:mainfrom
ekzhu:chatkit
Nov 5, 2025
Merged

Evan Mattson (moonbox3) merged 42 commits into
microsoft:mainfrom
ekzhu:chatkit

Conversation

@ekzhu

@ekzhu Eric Zhu (ekzhu) commented Oct 7, 2025 •

Copy link
Copy Markdown
Contributor

Motivation and Context

Introduce agent-framework-chatkit subpackage for integration with ChatKit for frontend UI.

Description

  • New subpackage with helpers: stream_agent_response, ThreadItemConverter and simple_to_agent_input to convert data types between ChatKit and Agent Framework
  • Added an end-to-end sample to demonstrate the integration.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

- Created a new frontend application using React and Vite for the ChatKit integration.
- Added essential files including package.json, vite.config.ts, and Tailwind CSS configuration.
- Implemented core components: App, Home, ChatKitPanel, ThemeToggle, and hooks for color scheme management.
- Established SQLite-based store implementation for ChatKit data persistence in store.py.
- Integrated theme toggling functionality for light and dark modes.
- Set up ESLint and TypeScript configurations for better development experience.
@markwallace-microsoft Mark Wallace (markwallace-microsoft) added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python labels Oct 7, 2025
@github-actions github-actions Bot changed the title feat: Add ChatKit integration with a new frontend application Python: feat: Add ChatKit integration with a new frontend application Oct 7, 2025
@ekzhu Eric Zhu (ekzhu) changed the title Python: feat: Add ChatKit integration with a new frontend application Python: feat: Add ChatKit integration with a sample application Oct 7, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Love it! But I'm a bit concerned about how much code there is in package vs sample, is there a way we can make that easier? and how will we maintain that front-end code?

Comment thread python/packages/chatkit/pyproject.toml Outdated
Comment thread python/samples/demos/chatkit-integration/app.py
@ekzhu

Eric Zhu (ekzhu) commented Oct 10, 2025 •

Copy link
Copy Markdown
Contributor Author

Waiting for fix to address 3.10 compatibility: openai/chatkit-python#12

@ekzhu
Eric Zhu (ekzhu) marked this pull request as ready for review October 17, 2025 17:42
Copilot AI review requested due to automatic review settings October 17, 2025 17:43

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.

Pull Request Overview

This PR introduces a new agent-framework-chatkit subpackage that enables integration between Microsoft Agent Framework and OpenAI ChatKit for frontend UI. The integration provides helper utilities to convert data types between the two frameworks and includes a complete end-to-end weather assistant sample application.

Key changes:

  • New Python package for ChatKit integration with utilities for streaming responses and type conversion
  • Complete sample application with FastAPI backend and React frontend
  • Updated pre-commit configuration to handle frontend JSON files

Reviewed Changes

Copilot reviewed 24 out of 28 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
python/packages/chatkit/agent_framework_chatkit/ Core integration package with converter and streaming utilities
python/packages/chatkit/tests/ Unit tests for the ChatKit integration functionality
python/samples/chatkit-integration/ Complete weather assistant sample with backend and frontend
python/packages/core/agent_framework/chatkit/ Lazy loading module for ChatKit integration
python/.pre-commit-config.yaml Updated to exclude frontend JSON files from checks
Files not reviewed (1)
  • python/samples/chatkit-integration/frontend/package-lock.json: Language not supported

Comment thread python/packages/chatkit/agent_framework_chatkit/_streaming.py Outdated
Comment thread python/samples/chatkit-integration/app.py Outdated
Comment thread python/packages/chatkit/agent_framework_chatkit/_streaming.py Outdated
Comment thread python/packages/chatkit/README.md Outdated
Comment thread python/samples/demos/chatkit-integration/app.py Outdated
@markwallace-microsoft

Mark Wallace (markwallace-microsoft) commented Nov 4, 2025 •

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/chatkit/agent_framework_chatkit
   _converter.py1304267%10, 118, 123, 171, 173, 341, 394, 396, 415–417, 419, 437, 439, 441, 444, 456, 466, 484, 504–526
   _streaming.py270100% 
TOTAL12085189384% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
1518 107 💤 0 ❌ 0 🔥 31.474s ⏱️

Comment thread python/packages/chatkit/agent_framework_chatkit/_streaming.py
Comment thread python/samples/demos/chatkit-integration/store.py
Comment thread python/samples/demos/chatkit-integration/app.py Outdated
Eric Zhu (ekzhu) and others added 2 commits November 4, 2025 17:50
Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
@moonbox3
Evan Mattson (moonbox3) added this pull request to the merge queue Nov 5, 2025
Merged via the queue into microsoft:main with commit 0c862e9 Nov 5, 2025
21 checks passed
@ekzhu
Eric Zhu (ekzhu) deleted the chatkit branch November 5, 2025 02:16
Aris Nguyen (arisng) pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
…osoft#1273)

* feat: Add ChatKit integration with a new frontend application

- Created a new frontend application using React and Vite for the ChatKit integration.
- Added essential files including package.json, vite.config.ts, and Tailwind CSS configuration.
- Implemented core components: App, Home, ChatKitPanel, ThemeToggle, and hooks for color scheme management.
- Established SQLite-based store implementation for ChatKit data persistence in store.py.
- Integrated theme toggling functionality for light and dark modes.
- Set up ESLint and TypeScript configurations for better development experience.

* git ignore

* fix mypy

* add mising file

* minimal frontend for chatkit sample

* update ignore files

* version

* set python version lowerbound on chatkit

* update project settings for chatkit

* update setup

* update setup

* update setup

* update setup

* weather widget

* add select city widget sample

* remove widget helper

* update chatkit to include file attachments and cover more thread item types

* update readme with mermaid diagram

* update diagram

* update instructions

* update chatkit dependency

* fix converter imports

* move to demos/

* move to demos/ -- rename references

* support multiple session instead of using global variable in sample

* support chunk streaming

* fix tests

* Update python/samples/demos/chatkit-integration/store.py

Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>

* use local host

---------

Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants