From 780608ff3f6d80f078480a2c53275a3e946e1df1 Mon Sep 17 00:00:00 2001 From: Ryan Sweet Date: Tue, 3 Dec 2024 13:16:47 -0800 Subject: [PATCH] add more handlers --- .../samples/xlang/hello_python_agent/user_input.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/packages/autogen-core/samples/xlang/hello_python_agent/user_input.py b/python/packages/autogen-core/samples/xlang/hello_python_agent/user_input.py index d2ab73e6f746..026ff9491488 100644 --- a/python/packages/autogen-core/samples/xlang/hello_python_agent/user_input.py +++ b/python/packages/autogen-core/samples/xlang/hello_python_agent/user_input.py @@ -32,6 +32,10 @@ async def handle_user_chat_input(self, message: input_types, ctx: MessageContext await self.publish_message(NewMessageReceived(message=response), topic_id=DefaultTopicId()) elif isinstance(message, Output): logger.info(message.message) + elif isinstance(message, ConversationClosed): + logger.info("Conversation closed. Goodbye!") + elif isinstance(message, NewMessageReceived): + logger.info(f"New message received: {message.message}") else: pass