🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
formatting
yzlin17aeb9f82591
diff --git a/metagpt/actions/ask_review.py b/metagpt/actions/ask_review.pyindex 0d671648b..a20395104 100644--- a/metagpt/actions/ask_review.py+++ b/metagpt/actions/ask_review.py@@ -27,7 +27,9 @@ class AskReview(Action):if plan:logger.info("Current overall plan:")logger.info(- "\n".join([f"{task.task_id}: {task.instruction}, is_finished: {task.is_finished}" for task in plan.tasks])+ "\n".join(+ [f"{task.task_id}: {task.instruction}, is_finished: {task.is_finished}" for task in plan.tasks]+ ))logger.info("most recent context:")diff --git a/metagpt/actions/write_analysis_code.py b/metagpt/actions/write_analysis_code.pyindex c5f9c9166..7d4597cf0 100644--- a/metagpt/actions/write_analysis_code.py+++ b/metagpt/actions/write_analysis_code.py@@ -12,7 +12,7 @@ import yamlfrom tenacity import retry, stop_after_attempt, wait_fixedfrom metagpt.actions import Action-from metagpt.const import METAGPT_ROOT, TOOL_SCHEMA_PATH+from metagpt.const import TOOL_SCHEMA_PATHfrom metagpt.llm import LLMfrom metagpt.logs import loggerfrom metagpt.prompts.ml_engineer import (diff --git a/metagpt/roles/code_interpreter.py b/metagpt/roles/code_interpreter.pyindex 9b13d8dcb..164c7cb12 100644--- a/metagpt/roles/code_interpreter.py+++ b/metagpt/roles/code_interpreter.py@@ -28,7 +28,9 @@ class CodeInterpreter(Role):make_udfs=False,**kwargs,):- super().__init__(name=name, profile=profile, goal=goal, auto_run=auto_run, use_tools=use_tools, make_udfs=make_udfs, **kwargs)+ super().__init__(+ name=name, profile=profile, goal=goal, auto_run=auto_run, use_tools=use_tools, make_udfs=make_udfs, **kwargs+ )self._set_react_mode(react_mode="plan_and_act", auto_run=auto_run, use_tools=use_tools)@property@@ -97,4 +99,6 @@ class CodeInterpreter(Role):logger.info("Plan completed. Now start to make tools ...")tool_maker = ToolMaker()for task in self.planner.plan.get_finished_tasks():- await tool_maker.make_tool(code=task.code, instruction=task.instruction, task_id=task.task_id, auto_run=self.auto_run)+ await tool_maker.make_tool(+ code=task.code, instruction=task.instruction, task_id=task.task_id, auto_run=self.auto_run+ )diff --git a/metagpt/roles/tool_maker.py b/metagpt/roles/tool_maker.pyindex 5453fd807..68d84b1e6 100644--- a/metagpt/roles/tool_maker.py+++ b/metagpt/roles/tool_maker.py@@ -45,7 +45,7 @@ class ToolMaker(Role):_, confirmed = await self.ask_review(auto_run=auto_run)if confirmed:make_tools.save(tool_code)-+async def ask_review(self, auto_run: bool = True):if not auto_run:review, confirmed = await AskReview().run()