-
Notifications
You must be signed in to change notification settings - Fork 7.9k
feat: add get_thread() method to BaseGroupChat for message history retrieval #7122
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
base: main
Are you sure you want to change the base?
Conversation
…trieval Add support for retrieving the current message thread from group chat teams. This allows users to access all messages exchanged between participants during the conversation, which is useful for monitoring progress, debugging, and displaying chat history in real-time. Changes: - Add GroupChatGetThread RPC event in _events.py - Implement handle_get_thread() RPC handler in BaseGroupChatManager - Add public get_thread() method to BaseGroupChat - Add comprehensive tests for RoundRobinGroupChat, SelectorGroupChat, and Swarm The implementation uses the existing RPC communication pattern to retrieve the internal _message_thread from the group chat manager. Closes microsoft#6085 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
@JobQiu please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Summary
This PR adds support for retrieving the current message thread from group chat teams via a new
get_thread()method. This allows users to access all messages exchanged between participants during the conversation.Why are these changes needed?
Users need a way to:
Currently, the message thread is stored internally in
BaseGroupChatManager._message_threadbut is not accessible from the public API.Changes
GroupChatGetThreadRPC event classGroupChatGetThreadeventsequential_message_typeslisthandle_get_thread()RPC handler that returnsself._message_threadGroupChatGetThreadeventasync def get_thread()method with full documentationtest_round_robin_group_chat_get_thread: Tests RoundRobinGroupChattest_selector_group_chat_get_thread: Tests SelectorGroupChattest_swarm_get_thread: Tests Swarm teamImplementation Details
The implementation follows the existing RPC communication pattern used by other team methods like
reset(),pause(), andresume(). It:GroupChatGetThreadRPC message fromBaseGroupChatto the managerhandle_get_thread()handler returns the internal_message_threadTest Plan
✅ All new tests pass (tested with both
single_threadedandembeddedruntime modes)✅ Code formatted with
poe format✅ Lint checks pass with
poe lint✅ Tests cover:
Usage Example
Related Issue
Closes #6085
🤖 Generated with Claude Code