mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
feat: +redis
This commit is contained in:
parent
cce76df319
commit
41e90b4f48
1 changed files with 2 additions and 2 deletions
|
|
@ -96,12 +96,12 @@ class BrainMemory(pydantic.BaseModel):
|
|||
async def loads(redis_key: str) -> "BrainMemory":
|
||||
redis = Redis()
|
||||
if not redis.is_valid() or not redis_key:
|
||||
return False
|
||||
return BrainMemory()
|
||||
v = await redis.get(key=redis_key)
|
||||
if not v:
|
||||
data = json.loads(v)
|
||||
return BrainMemory(**data)
|
||||
return None
|
||||
return BrainMemory()
|
||||
|
||||
async def dumps(self, redis_key: str, timeout_sec: int = 30 * 60):
|
||||
redis = Redis()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue