-
Notifications
You must be signed in to change notification settings - Fork 733
Python: ChatKit sample fixes #2174
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
Conversation
There was a problem hiding this 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 critical context retention issues in the ChatKit integration sample by ensuring the agent maintains conversation history throughout the chat session. Previously, only the most recent user message was being passed to the agent, causing disjointed conversations.
Key Changes
- Modified the
respondmethod to load full thread history before processing each message, ensuring conversation context is maintained - Added automatic thread title generation using LLM-based summarization
- Applied code formatting fixes including import reordering and whitespace cleanup
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/demos/chatkit-integration/app.py | Core fix: loads full thread history for context retention; adds LLM-based thread title generation; reorganizes imports |
| python/packages/chatkit/README.md | Updates documentation example to show loading full thread history instead of just the current message |
| python/samples/demos/chatkit-integration/store.py | Formatting changes: reorders imports alphabetically, reformats multi-line statements |
| python/samples/demos/chatkit-integration/attachment_store.py | Formatting changes: reorders TYPE_CHECKING import, removes trailing whitespace |
| python/samples/demos/chatkit-integration/weather_widget.py | Formatting: removes extra blank line |
Motivation and Context
While running the ChatKit sample, it was noticed that we do not hold on to the thread as the convo continues. The introduces some disjointed chats with the LLM as we don't carry the context. Additionally, the thread names were left as "New Thread." Introduce a quick method to make a cheap call to get the context for the thread.
Description
Fixes. Other fixes, outside of app, are formatting / lint / package reordering.
Contribution Checklist