Skip to content

Commit

Permalink
Correct hook order on a_generate_reply (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
marklysze authored Feb 24, 2025
1 parent 0c08bf7 commit eb5566c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2489,14 +2489,14 @@ async def a_generate_reply(
# Call the hookable method that gives registered hooks a chance to update agent state, used for their context variables.
self.update_agent_state_before_reply(messages)

# Call the hookable method that gives registered hooks a chance to process all messages.
# Message modifications do not affect the incoming messages or self._oai_messages.
messages = self.process_all_messages_before_reply(messages)

# Call the hookable method that gives registered hooks a chance to process the last message.
# Message modifications do not affect the incoming messages or self._oai_messages.
messages = self.process_last_received_message(messages)

# Call the hookable method that gives registered hooks a chance to process all messages.
# Message modifications do not affect the incoming messages or self._oai_messages.
messages = self.process_all_messages_before_reply(messages)

for reply_func_tuple in self._reply_func_list:
reply_func = reply_func_tuple["reply_func"]
if "exclude" in kwargs and reply_func in kwargs["exclude"]:
Expand Down

0 comments on commit eb5566c

Please sign in to comment.