refactor: brain memory

This commit is contained in:
莘权 马 2023-09-07 19:45:42 +08:00
parent 948d1577e4
commit c66012d087
2 changed files with 2 additions and 4 deletions

View file

@ -8,6 +8,7 @@
from collections import defaultdict
from typing import Iterable, Type
from metagpt.actions import Action
from metagpt.schema import Message
@ -16,8 +17,6 @@ class Memory:
def __init__(self):
"""Initialize an empty storage list and an empty index dictionary"""
from metagpt.actions import Action
self.storage: list[Message] = []
self.index: dict[Type[Action], list[Message]] = defaultdict(list)

View file

@ -6,7 +6,6 @@
@Desc : MetaGPT LLM related APIs
"""
from metagpt.memory.brain_memory import BrainMemory
from metagpt.provider import OpenAIGPTAPI
@ -16,7 +15,7 @@ class MetaGPTLLMAPI(OpenAIGPTAPI):
def __init__(self):
super().__init__()
async def get_summary(self, memory: BrainMemory, max_words=200, keep_language: bool = False, **kwargs) -> str:
async def get_summary(self, memory, max_words=200, keep_language: bool = False, **kwargs) -> str:
"""
Return string in the following format
[