feat(agentchat): add get_thread() to BaseGroupChat (closes #6085)#7605
Open
seetaram-codebase wants to merge 2 commits intomicrosoft:mainfrom
Open
feat(agentchat): add get_thread() to BaseGroupChat (closes #6085)#7605seetaram-codebase wants to merge 2 commits intomicrosoft:mainfrom
seetaram-codebase wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Implements the feature requested in #6085: expose the group chat manager's internal
_message_threadas a public async API onBaseGroupChat.Changes
_events.py— newGroupChatGetThreadEventRPC message type (empty model, likeGroupChatReset)._base_group_chat_manager.py— new@rpchandlerhandle_get_thread()that returnslist(self._message_thread)(shallow copy to protect internal state)._base_group_chat.py— newasync def get_thread() -> List[BaseAgentEvent | BaseChatMessage]onBaseGroupChatthat sends the RPC to the manager and returns the result. Works during a run and after completion; handles both embedded and external runtimes.tests/test_group_chat_get_thread.py— 4pytest-asynciotests (embedded + external runtime fixtures):test_get_thread_after_run— non-empty snapshot matches TaskResult messagestest_get_thread_not_initialized_raises— RuntimeError before first runtest_get_thread_returns_snapshot— mutating returned list does not affect managertest_get_thread_while_running— concurrent calls during a live run return a growing threadRelated issue number
Closes #6085
Checks
get_thread()+get_thread_while_runningmay need runtime tuning)