🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
refactor: get_class_name
莘权 马710bc40b0ab4
diff --git a/metagpt/memory/memory.py b/metagpt/memory/memory.pyindex 9d526420f..2f4c9d20b 100644--- a/metagpt/memory/memory.py+++ b/metagpt/memory/memory.py@@ -10,7 +10,6 @@ from collections import defaultdictfrom typing import Iterable, Setfrom metagpt.schema import Message-from metagpt.utils.common import any_to_str, any_to_str_setclass Memory:@@ -76,14 +75,12 @@ class Memory:def get_by_action(self, action) -> list[Message]:"""Return all messages triggered by a specified Action"""- idx = any_to_str(action)- return self.index[idx]+ return self.index[action]def get_by_actions(self, actions: Set) -> list[Message]:"""Return all messages triggered by specified Actions"""- idxs = any_to_str_set(actions)rsp = []- for action in idxs:+ for action in actions:if action not in self.index:continuersp += self.index[action]