adjust the order of message processing (#1841)

This commit is contained in:
Chi Wang 2024-03-02 18:10:35 -08:00 committed by GitHub
parent 2912f554a3
commit f749deeda9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -1732,14 +1732,14 @@ class ConversableAgent(LLMAgent):
if messages is None: if messages is None:
messages = self._oai_messages[sender] messages = self._oai_messages[sender]
# 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. # 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. # Message modifications do not affect the incoming messages or self._oai_messages.
messages = self.process_last_received_message(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: for reply_func_tuple in self._reply_func_list:
reply_func = reply_func_tuple["reply_func"] reply_func = reply_func_tuple["reply_func"]
if "exclude" in kwargs and reply_func in kwargs["exclude"]: if "exclude" in kwargs and reply_func in kwargs["exclude"]:

View File

@ -1 +1 @@
__version__ = "0.2.16" __version__ = "0.2.17"