🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
rebase on #589
better62917087533bbea
diff --cc metagpt/actions/prepare_documents.pyindex 696dc9a89,3c0885954..9b5128cbd--- a/metagpt/actions/prepare_documents.py+++ b/metagpt/actions/prepare_documents.py@@@ -25,10 -20,6 +25,9 @@@ from metagpt.utils.git_repository imporclass PrepareDocuments(Action):"""PrepareDocuments Action: initialize project folder and add new requirements to docs/requirements.txt."""-+ name: str = "PrepareDocuments"+ context: Optional[str] = None+ llm: BaseGPTAPI = Field(default_factory=LLM)def _init_repo(self):"""Initialize the Git environment."""diff --cc metagpt/memory/longterm_memory.pyindex 069740054,ab2214261..76a8deabb--- a/metagpt/memory/longterm_memory.py+++ b/metagpt/memory/longterm_memory.py@@@ -22,13 -16,12 +22,12 @@@ class LongTermMemory(Memory)- recover memory when it staruped- update memory when it changed"""-+ memory_storage: MemoryStorage = Field(default_factory=MemoryStorage)+ rc: Optional["RoleContext"] = None+ msg_from_recover: bool = False- def __init__(self):- self.memory_storage: MemoryStorage = MemoryStorage()- super().__init__()- self.rc = None # RoleContext- self.msg_from_recover = False+ class Config:+ arbitrary_types_allowed = Truedef recover_memory(self, role_id: str, rc: "RoleContext"):messages = self.memory_storage.recover_memory(role_id)diff --cc metagpt/roles/architect.pyindex 9edfe33d9,fce6c3425..a36cd6e93--- a/metagpt/roles/architect.py+++ b/metagpt/roles/architect.py@@@ -22,15 -21,18 +22,14 @@@ class Architect(Role)goal (str): Primary goal or responsibility of the architect.constraints (str): Constraints or guidelines for the architect."""-+ name: str = Field(default="Bob")+ profile: str = Field(default="Architect")+ goal: str = Field(default="design a concise, usable, complete software system")+ constraints: str = Field(default="make sure the architecture is simple enough and use appropriate open source "+ "libraries. Use same language as user requirement")- def __init__(- self,- name: str = "Bob",- profile: str = "Architect",- goal: str = "design a concise, usable, complete software system",- constraints: str = "make sure the architecture is simple enough and use appropriate open source libraries."- "Use same language as user requirement",- ) -> None:- """Initializes the Architect with given attributes."""- super().__init__(name, profile, goal, constraints)-+ def __init__(self, **kwargs) -> None:+ super().__init__(**kwargs)# Initialize actions specific to the Architect roleself._init_actions([WriteDesign])diff --cc metagpt/roles/role.pyindex e57f21ec3,bf37a6637..0bc129174--- a/metagpt/roles/role.py+++ b/metagpt/roles/role.py@@@ -27,11 -25,8 +27,10 @@@ from typing import Iterable, Set, Typefrom pydantic import BaseModel, Field--from metagpt.actions import Action, ActionOutput, UserRequirement+from metagpt.actions.action import Action, ActionOutput, action_subclass_registryfrom metagpt.actions.action_node import ActionNode+from metagpt.actions.add_requirement import UserRequirement+from metagpt.const import SERDESER_PATHfrom metagpt.llm import LLM, HumanProviderfrom metagpt.logs import loggerfrom metagpt.memory import Memorydiff --cc metagpt/startup.pyindex b66f9e305,a1af90ffc..5a3e482a4--- a/metagpt/startup.py+++ b/metagpt/startup.py@@@ -3,6 -3,6 +3,7 @@@import asyncioimport typer++from pathlib import Pathfrom metagpt.config import CONFIGdiff --cc metagpt/utils/serialize.pyindex 8ad46a120,5e52846e1..7bfd55008--- a/metagpt/utils/serialize.py+++ b/metagpt/utils/serialize.py@@@ -4,9 -4,8 +4,8 @@@import copyimport pickle-from typing import Dict, List-+from metagpt.utils.common import import_classfrom metagpt.actions.action_node import ActionNodefrom metagpt.schema import Message