🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
feat: merge issue #1095
莘权 马3084f943bf94
diff --cc metagpt/roles/engineer.pyindex 6a4f905ad,41735023a..b07973ed4--- a/metagpt/roles/engineer.py+++ b/metagpt/roles/engineer.py@@@ -22,7 -22,7 +22,7 @@@ from __future__ import annotationimport jsonfrom collections import defaultdictfrom pathlib import Path- from typing import List, Set-from typing import Optional, Set++from typing import List, Optional, Setfrom metagpt.actions import Action, WriteCode, WriteCodeReview, WriteTasksfrom metagpt.actions.fix_bug import FixBug@@@ -393,10 -391,14 +400,22 @@@ class Engineer(Role)"""AgentStore uses this attribute to display to the user what actions the current role should take."""return self.next_todo_action+ async def _init_python_folder(self, task_list: List[str]):+ for i in task_list:+ filename = Path(i)+ if filename.suffix != ".py":+ continue+ workdir = self.src_workspace / filename.parent+ await init_python_folder(workdir)+++ async def _is_fixbug(self) -> bool:+ fixbug_doc = await self.project_repo.docs.get(BUGFIX_FILENAME)+ return bool(fixbug_doc and fixbug_doc.content)++ async def _get_any_code_plan_and_change(self) -> Optional[Document]:+ changed_files = self.project_repo.docs.code_plan_and_change.changed_files+ for filename in changed_files.keys():+ doc = await self.project_repo.docs.code_plan_and_change.get(filename)+ if doc and doc.content:+ return doc+ return None