Migrating from pyautogen 0.3 to autogen v0.4.0: How to Log Group Chat Messages in correct order using the new SelectorGroupChat #5100
Unanswered
aayushmittal2
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@aayushmittal2, for from autogen_agentchat.base import TaskResult
task_result = None
async for message in group_chat.run_stream(task=prompt):
print(message) # Or log it.
if isinstance(message, TaskResult):
task_result = message
# Use the task_result as before. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I’ve been successfully using pyautogen v0.3.2 to orchestrate multi-agent workflows and capture real-time group chat messages for logging and notifications. My current setup uses a custom GroupChatLogger class that periodically checks new messages, does some domain-specific processing (like extracting search links, building Markdown from JSON, sending notifications, etc.), and caches these logs in Redis.
Below is a simplified version of my custom logger and how it’s used in pyautogen v0.3.2 . This below code snippit works well and tracks the execution.
The New autogen v0.4.0 Approach
Now, with autogen v0.4.0, I’m using SelectorGroupChat and passing in a model_client, plus new termination conditions, etc. The SelectorGroupChat works well in itself but I am not able to figure how to setup the logger functionality to track the execution in correct flow and use the agent communcation message for notification.
Here’s an abbreviated snippet of how I’m creating and running the group chat:
How can I hook into each new message in SelectorGroupChat so I can retrieve them in real-time the way I did with manager.groupchat.messages in pyautogen?
Any examples or hints on how others are doing real-time logging within the new autogen v0.4.0 SelectorGroupChat would be super helpful!
Beta Was this translation helpful? Give feedback.
All reactions