Skip to content

Commit

Permalink
Also register functions from super class
Browse files Browse the repository at this point in the history
  • Loading branch information
BeibinLi committed Aug 5, 2023
1 parent 9218808 commit b9aa473
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flaml/autogen/agentchat/responsive_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ def __init__(
self.reply_at_receive = defaultdict(bool)

# Handle class-specific reply defined in the "register_auto_reply" decorator.
for name, method in vars(type(self)).items():
if hasattr(method, "_registered_for") and hasattr(method, "_insert_pos"):
self._class_specific_reply.insert(method._insert_pos, (method._registered_for, method))
for cls in reversed(type(self).__mro__): # loop all supers
for name, method in vars(cls).items(): # loop all functions
if hasattr(method, "_registered_for") and hasattr(method, "_insert_pos"):
self._class_specific_reply.insert(method._insert_pos, (method._registered_for, method))

@property
def system_message(self):
Expand Down

0 comments on commit b9aa473

Please sign in to comment.