From 801033f554f7945959e517b6bc081d1cd2efb169 Mon Sep 17 00:00:00 2001 From: Drew Gillson Date: Sat, 13 Jul 2024 01:04:46 -0600 Subject: [PATCH] Fix AttributeError: 'NoneType' object has no attribute 'name' There is a bug related to the interplay between the society of mind agent and the FileLogger, probably somewhere around https://github.com/microsoft/autogen/blob/main/autogen/agentchat/contrib/society_of_mind_agent.py#L181, which causes an empty name property to be sent. The FileLogger should gracefully handle this circumstance and not return an error to the function caller. --- autogen/logger/file_logger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen/logger/file_logger.py b/autogen/logger/file_logger.py index 61a8a6335284..0b9171d2594f 100644 --- a/autogen/logger/file_logger.py +++ b/autogen/logger/file_logger.py @@ -89,7 +89,7 @@ def log_chat_completion( thread_id = threading.get_ident() source_name = None if isinstance(source, str): - source_name = source + source_name = getattr(source, "name", "unknown") else: source_name = source.name try: