mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
feat: fix memory.add
This commit is contained in:
parent
b794e5d73d
commit
9745dd12f6
1 changed files with 1 additions and 1 deletions
|
|
@ -226,9 +226,9 @@ class Role:
|
|||
# Read unprocessed messages from the msg buffer.
|
||||
news = self._rc.msg_buffer.pop_all()
|
||||
# Store the read messages in your own memory to prevent duplicate processing.
|
||||
old_messages = self._rc.memory.get()
|
||||
self._rc.memory.add_batch(news)
|
||||
# Filter out messages of interest.
|
||||
old_messages = self._rc.memory.get()
|
||||
self._rc.news = [n for n in news if n.cause_by in self._rc.watch and n not in old_messages]
|
||||
|
||||
# Design Rules:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue