Skip to content

Commit

Permalink
[bugfix][memory]modified get_msg_by_role_name func
Browse files Browse the repository at this point in the history
  • Loading branch information
yunjiu committed Nov 14, 2024
1 parent 8f67f66 commit 6bd140d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion muagent/connector/memory_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,8 @@ def init_global_msg(self, chat_index: str, role_name: str, role_content: str, ro
return False

def get_msg_by_role_name(self, chat_index: str, role_name: str) -> Optional[Message]:
memory = self.get_memory_pool(chat_index)
memory = self.get_memory_pool_by_all({"chat_index": chat_index, "role_name": role_name})
# memory = self.get_memory_pool(chat_index)
for msg in memory.messages:
if msg.role_name == role_name:
return msg
Expand Down

0 comments on commit 6bd140d

Please sign in to comment.