feat: truncated history

This commit is contained in:
莘权 马 2023-09-07 17:09:12 +08:00
parent 05532426c0
commit 92402bedd4

View file

@ -110,6 +110,7 @@ class BrainMemory(pydantic.BaseModel):
if self.to_int(msg.id, 0) <= self.to_int(self.last_history_id, -1):
return
self.history.append(msg.dict())
self.last_history_id = str(msg.id)
self.is_dirty = True
def exists(self, text) -> bool: