refactor: brain memory

This commit is contained in:
莘权 马 2023-09-07 23:05:30 +08:00
parent f2da313548
commit f92aeb0e50

View file

@ -134,7 +134,8 @@ class BrainMemory(pydantic.BaseModel):
max_token_count = DEFAULT_MAX_TOKENS
max_count = 100
texts = [self.historical_summary]
for m in self.history:
for i in self.history:
m = Message(**i)
texts.append(m.content)
text = "\n".join(texts)
text_length = len(text)