mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
refactor: Update according to Chapter 2.1.3.2 of RFC 116
This commit is contained in:
parent
1ff99b95ac
commit
c9f9c5c73e
1 changed files with 5 additions and 4 deletions
|
|
@ -40,10 +40,11 @@ class LongTermMemory(Memory):
|
|||
|
||||
def add(self, message: Message):
|
||||
super(LongTermMemory, self).add(message)
|
||||
if message.contain_any(self.rc.watch) and not self.msg_from_recover:
|
||||
# currently, only add role's watching messages to its memory_storage
|
||||
# and ignore adding messages from recover repeatedly
|
||||
self.memory_storage.add(message)
|
||||
for action in self.rc.watch:
|
||||
if message.cause_by == action and not self.msg_from_recover:
|
||||
# currently, only add role's watching messages to its memory_storage
|
||||
# and ignore adding messages from recover repeatedly
|
||||
self.memory_storage.add(message)
|
||||
|
||||
def find_news(self, observed: list[Message], k=0) -> list[Message]:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue