mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-05 14:55:18 +02:00
feat: +cache
This commit is contained in:
parent
ec8e455a59
commit
ebe5217f70
1 changed files with 7 additions and 0 deletions
|
|
@ -113,3 +113,10 @@ class BrainMemory(pydantic.BaseModel):
|
|||
self.history = []
|
||||
await self.dumps(redis_key=redis_key, redis_conf=redis_conf)
|
||||
self.is_dirty = False
|
||||
|
||||
def add_history(self, msg: Message):
|
||||
if msg.id:
|
||||
if int(msg.id) < int(self.last_history_id):
|
||||
return
|
||||
self.history.append(msg.dict())
|
||||
self.is_dirty = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue