mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-27 14:25:20 +02:00
refactor: brain memory
This commit is contained in:
parent
948d1577e4
commit
c66012d087
2 changed files with 2 additions and 4 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue