🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
update: 优化记忆
zhanglei1e7f0569183b
diff --git a/metagpt/memory/brain_memory.py b/metagpt/memory/brain_memory.pyindex 22af67236..586285e4f 100644--- a/metagpt/memory/brain_memory.py+++ b/metagpt/memory/brain_memory.py@@ -34,6 +34,7 @@ class BrainMemory(pydantic.BaseModel):historical_summary: str = ""last_history_id: str = ""is_dirty: bool = False+ last_talk: str = ""def add_talk(self, msg: Message):msg.add_tag(MessageType.Talk.value)@@ -65,15 +66,6 @@ class BrainMemory(pydantic.BaseModel):return "\n".join(texts)- @property- def last_talk(self):- if len(self.history) == 0:- return None- last_msg = Message(**self.history[-1])- if not last_msg.is_contain(MessageType.Talk.value):- return None- return last_msg.content-@staticmethodasync def loads(redis_key: str, redis_conf: Dict = None) -> "BrainMemory":redis = Redis(conf=redis_conf)