Skip to content

Commit

Permalink
Fix AttributeError: 'NoneType' object has no attribute 'name' (#3127)
Browse files Browse the repository at this point in the history
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.

Co-authored-by: Chi Wang <[email protected]>
Co-authored-by: Jack Gerrits <[email protected]>
  • Loading branch information
3 people authored Sep 25, 2024
1 parent ece6924 commit ddc2eaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autogen/logger/file_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,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:
Expand Down

0 comments on commit ddc2eaa

Please sign in to comment.