Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

refactor: brain memory

莘权 马c36e1d6f1a85
diff --git a/metagpt/memory/brain_memory.py b/metagpt/memory/brain_memory.py
index 805ef1b27..45a7c0691 100644
--- a/metagpt/memory/brain_memory.py
+++ b/metagpt/memory/brain_memory.py
@@ -103,7 +103,7 @@ class BrainMemory(pydantic.BaseModel):
@staticmethod
def to_redis_key(prefix: str, user_id: str, chat_id: str):
- return f"{prefix}:{chat_id}:{user_id}"
+ return f"{prefix}:{user_id}:{chat_id}"
async def set_history_summary(self, history_summary, redis_key, redis_conf):
if self.historical_summary == history_summary:
@@ -294,4 +294,9 @@ class BrainMemory(pydantic.BaseModel):
else:
return None, input_string
+ def set_llm_type(self, v):
+ if v:
+ self.llm_type = v
+ self.is_dirty = True
+
DEFAULT_TOKEN_SIZE = 500