π The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
unified Interpreter naming
yzlin82a0d03e313f
diff --git a/README.md b/README.mdindex d3a035abe..a1aa5ded8 100644--- a/README.md+++ b/README.md@@ -26,7 +26,7 @@</p>## News-π Feb. 08, 2024: [v0.7.0](https://github.com/geekan/MetaGPT/releases/tag/v0.7.0) released, supporting assigning different LLMs to different Roles. We also introduced CodeInterpreter, a powerful agent capable of solving a wide range of real-world problems.+π Feb. 08, 2024: [v0.7.0](https://github.com/geekan/MetaGPT/releases/tag/v0.7.0) released, supporting assigning different LLMs to different Roles. We also introduced [Interpreter](https://github.com/geekan/MetaGPT/blob/main/examples/mi/README.md), a powerful agent capable of solving a wide range of real-world problems.π Jan. 16, 2024: Our paper [MetaGPT: Meta Programming for A Multi-Agent Collaborative Framework](https://arxiv.org/abs/2308.00352) accepted for oral presentation **(top 1.2%)** at ICLR 2024, **ranking #1** in the LLM-based Agent category.diff --git a/examples/ci/README.md b/examples/ci/README.mddeleted file mode 100644index d526b94c7..000000000--- a/examples/ci/README.md+++ /dev/null@@ -1,18 +0,0 @@-# Code Interpreter (CI)--## What is CodeInterpreter-CodeInterpreter is an agent who solves problems through codes. It understands user requirements, makes plans, writes codes for execution, and uses tools if necessary. These capabilities enable it to tackle a wide range of scenarios, please check out the examples below.--## Example List-- Data visualization-- Machine learning modeling-- Image background removal-- Solve math problems-- Receipt OCR-- Tool usage: web page imitation-- Tool usage: web crawling-- Tool usage: text2image-- Tool usage: email summarization and response-- More on the way!--Please see [here](https://docs.deepwisdom.ai/main/en/guide/use_cases/agent/code_interpreter/ci_intro.html) for detailed explanation.\ No newline at end of filediff --git a/examples/mi/README.md b/examples/mi/README.mdnew file mode 100644index 000000000..1734ba388--- /dev/null+++ b/examples/mi/README.md@@ -0,0 +1,18 @@+# MetaGPT Interpreter (MI)++## What is Interpreter+Interpreter is an agent who solves problems through codes. It understands user requirements, makes plans, writes codes for execution, and uses tools if necessary. These capabilities enable it to tackle a wide range of scenarios, please check out the examples below.++## Example List+- Data visualization+- Machine learning modeling+- Image background removal+- Solve math problems+- Receipt OCR+- Tool usage: web page imitation+- Tool usage: web crawling+- Tool usage: text2image+- Tool usage: email summarization and response+- More on the way!++Please see [here](https://docs.deepwisdom.ai/main/en/guide/use_cases/agent/interpreter/mi_intro.html) for detailed explanation.\ No newline at end of filediff --git a/examples/ci/crawl_webpage.py b/examples/mi/crawl_webpage.pysimilarity index 76%rename from examples/ci/crawl_webpage.pyrename to examples/mi/crawl_webpage.pyindex 2db9e407b..b5d2fb3d0 100644--- a/examples/ci/crawl_webpage.py+++ b/examples/mi/crawl_webpage.py@@ -5,15 +5,15 @@@File : crawl_webpage.py"""-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreterasync def main():prompt = """Get data from `paperlist` table in https://papercopilot.com/statistics/iclr-statistics/iclr-2024-statistics/,and save it to a csv file. paper title must include `multiagent` or `large language model`. *notice: print key variables*"""- ci = CodeInterpreter(goal=prompt, use_tools=True)+ mi = Interpreter(use_tools=True)- await ci.run(prompt)+ await mi.run(prompt)if __name__ == "__main__":diff --git a/examples/ci/data_visualization.py b/examples/mi/data_visualization.pysimilarity index 55%rename from examples/ci/data_visualization.pyrename to examples/mi/data_visualization.pyindex 8dc4340d4..2e4acc9b4 100644--- a/examples/ci/data_visualization.py+++ b/examples/mi/data_visualization.py@@ -1,11 +1,11 @@import asyncio-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreterasync def main(requirement: str = ""):- code_interpreter = CodeInterpreter(use_tools=False)- await code_interpreter.run(requirement)+ mi = Interpreter(use_tools=False)+ await mi.run(requirement)if __name__ == "__main__":diff --git a/examples/ci/email_summary.py b/examples/mi/email_summary.pysimilarity index 90%rename from examples/ci/email_summary.pyrename to examples/mi/email_summary.pyindex d6fa283ca..e1511c5b0 100644--- a/examples/ci/email_summary.py+++ b/examples/mi/email_summary.py@@ -6,7 +6,7 @@"""import os-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreterasync def main():@@ -22,9 +22,9 @@ async def main():Firstly, Please help me fetch the latest 5 senders and full letter contents.Then, summarize each of the 5 emails into one sentence (you can do this by yourself, no need to import other models to do this) and output them in a markdown format."""- ci = CodeInterpreter(use_tools=True)+ mi = Interpreter(use_tools=True)- await ci.run(prompt)+ await mi.run(prompt)if __name__ == "__main__":diff --git a/examples/ci/imitate_webpage.py b/examples/mi/imitate_webpage.pysimilarity index 81%rename from examples/ci/imitate_webpage.pyrename to examples/mi/imitate_webpage.pyindex 6a83d3a33..0e9ca731d 100644--- a/examples/ci/imitate_webpage.py+++ b/examples/mi/imitate_webpage.py@@ -5,7 +5,7 @@@Author : mannaandpoem@File : imitate_webpage.py"""-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreterasync def main():@@ -15,9 +15,9 @@ Firstly, utilize Selenium and WebDriver for rendering.Secondly, convert image to a webpage including HTML, CSS and JS in one go.Finally, save webpage in a text file.Note: All required dependencies and environments have been fully installed and configured."""- ci = CodeInterpreter(use_tools=True)+ mi = Interpreter(use_tools=True)- await ci.run(prompt)+ await mi.run(prompt)if __name__ == "__main__":diff --git a/examples/ci/machine_learning.py b/examples/mi/machine_learning.pysimilarity index 66%rename from examples/ci/machine_learning.pyrename to examples/mi/machine_learning.pyindex 9eda981ac..ee3b47f26 100644--- a/examples/ci/machine_learning.py+++ b/examples/mi/machine_learning.py@@ -1,11 +1,11 @@import asyncio-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreterasync def main(requirement: str):- role = CodeInterpreter(auto_run=True, use_tools=False)- await role.run(requirement)+ mi = Interpreter(auto_run=True, use_tools=False)+ await mi.run(requirement)if __name__ == "__main__":diff --git a/examples/ci/ml_engineer_with_tools.py b/examples/mi/ml_engineer_with_tools.pysimilarity index 94%rename from examples/ci/ml_engineer_with_tools.pyrename to examples/mi/ml_engineer_with_tools.pyindex 66d37316b..9d0e7f951 100644--- a/examples/ci/ml_engineer_with_tools.py+++ b/examples/mi/ml_engineer_with_tools.py@@ -1,6 +1,6 @@import asyncio-from metagpt.roles.ci.ml_engineer import MLEngineer+from metagpt.roles.mi.ml_engineer import MLEngineerasync def main(requirement: str):diff --git a/examples/ci/ocr_receipt.py b/examples/mi/ocr_receipt.pysimilarity index 72%rename from examples/ci/ocr_receipt.pyrename to examples/mi/ocr_receipt.pyindex dc2db2d01..ffa5cff05 100644--- a/examples/ci/ocr_receipt.py+++ b/examples/mi/ocr_receipt.py@@ -1,16 +1,16 @@-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreterasync def main():# Notice: pip install metagpt[ocr] before using this exampleimage_path = "image.jpg"language = "English"- requirement = f"""This is a {language} invoice image.+ requirement = f"""This is a {language} receipt image.Your goal is to perform OCR on images using PaddleOCR, then extract the total amount from ocr text results, and finally save as table. Image path: {image_path}.NOTE: The environments for Paddle and PaddleOCR are all ready and has been fully installed."""- ci = CodeInterpreter()+ mi = Interpreter()- await ci.run(requirement)+ await mi.run(requirement)if __name__ == "__main__":diff --git a/examples/ci/rm_image_background.py b/examples/mi/rm_image_background.pysimilarity index 71%rename from examples/ci/rm_image_background.pyrename to examples/mi/rm_image_background.pyindex 83dbbdc77..57e89b103 100644--- a/examples/ci/rm_image_background.py+++ b/examples/mi/rm_image_background.py@@ -1,11 +1,11 @@import asyncio-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreterasync def main(requirement: str = ""):- code_interpreter = CodeInterpreter(use_tools=False)- await code_interpreter.run(requirement)+ mi = Interpreter(use_tools=False)+ await mi.run(requirement)if __name__ == "__main__":diff --git a/examples/ci/sd_tool_usage.py b/examples/mi/sd_tool_usage.pysimilarity index 70%rename from examples/ci/sd_tool_usage.pyrename to examples/mi/sd_tool_usage.pyindex b4642af23..f8507a411 100644--- a/examples/ci/sd_tool_usage.py+++ b/examples/mi/sd_tool_usage.py@@ -4,12 +4,12 @@# @Desc :import asyncio-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreterasync def main(requirement: str = ""):- code_interpreter = CodeInterpreter(use_tools=True, goal=requirement)- await code_interpreter.run(requirement)+ mi = Interpreter(use_tools=True, goal=requirement)+ await mi.run(requirement)if __name__ == "__main__":diff --git a/examples/ci/solve_math_problems.py b/examples/mi/solve_math_problems.pysimilarity index 66%rename from examples/ci/solve_math_problems.pyrename to examples/mi/solve_math_problems.pyindex 8c660975b..dce2edb00 100644--- a/examples/ci/solve_math_problems.py+++ b/examples/mi/solve_math_problems.py@@ -1,11 +1,11 @@import asyncio-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreterasync def main(requirement: str = ""):- code_interpreter = CodeInterpreter(use_tools=False)- await code_interpreter.run(requirement)+ mi = Interpreter(use_tools=False)+ await mi.run(requirement)if __name__ == "__main__":diff --git a/metagpt/actions/__init__.py b/metagpt/actions/__init__.pyindex 363b4fd33..19a7c10d5 100644--- a/metagpt/actions/__init__.py+++ b/metagpt/actions/__init__.py@@ -22,9 +22,9 @@ from metagpt.actions.write_code_review import WriteCodeReviewfrom metagpt.actions.write_prd import WritePRDfrom metagpt.actions.write_prd_review import WritePRDReviewfrom metagpt.actions.write_test import WriteTest-from metagpt.actions.ci.execute_nb_code import ExecuteNbCode-from metagpt.actions.ci.write_analysis_code import WriteCodeWithoutTools, WriteCodeWithTools-from metagpt.actions.ci.write_plan import WritePlan+from metagpt.actions.mi.execute_nb_code import ExecuteNbCode+from metagpt.actions.mi.write_analysis_code import WriteCodeWithoutTools, WriteCodeWithTools+from metagpt.actions.mi.write_plan import WritePlanclass ActionType(Enum):diff --git a/metagpt/actions/ci/__init__.py b/metagpt/actions/mi/__init__.pysimilarity index 100%rename from metagpt/actions/ci/__init__.pyrename to metagpt/actions/mi/__init__.pydiff --git a/metagpt/actions/ci/ask_review.py b/metagpt/actions/mi/ask_review.pysimilarity index 100%rename from metagpt/actions/ci/ask_review.pyrename to metagpt/actions/mi/ask_review.pydiff --git a/metagpt/actions/ci/debug_code.py b/metagpt/actions/mi/debug_code.pysimilarity index 98%rename from metagpt/actions/ci/debug_code.pyrename to metagpt/actions/mi/debug_code.pyindex 4a6617dc6..db3b7a9db 100644--- a/metagpt/actions/ci/debug_code.py+++ b/metagpt/actions/mi/debug_code.py@@ -1,6 +1,6 @@from __future__ import annotations-from metagpt.actions.ci.write_analysis_code import BaseWriteAnalysisCode+from metagpt.actions.mi.write_analysis_code import BaseWriteAnalysisCodefrom metagpt.logs import loggerfrom metagpt.schema import Messagefrom metagpt.utils.common import create_func_call_configdiff --git a/metagpt/actions/ci/execute_nb_code.py b/metagpt/actions/mi/execute_nb_code.pysimilarity index 100%rename from metagpt/actions/ci/execute_nb_code.pyrename to metagpt/actions/mi/execute_nb_code.pydiff --git a/metagpt/actions/ci/ml_action.py b/metagpt/actions/mi/ml_action.pysimilarity index 93%rename from metagpt/actions/ci/ml_action.pyrename to metagpt/actions/mi/ml_action.pyindex e18d0fd20..60b2fb547 100644--- a/metagpt/actions/ci/ml_action.py+++ b/metagpt/actions/mi/ml_action.py@@ -3,14 +3,14 @@ from __future__ import annotationsfrom typing import Tuplefrom metagpt.actions import Action-from metagpt.actions.ci.write_analysis_code import WriteCodeWithTools-from metagpt.prompts.ci.ml_action import (+from metagpt.actions.mi.write_analysis_code import WriteCodeWithTools+from metagpt.prompts.mi.ml_action import (ML_GENERATE_CODE_PROMPT,ML_TOOL_USAGE_PROMPT,PRINT_DATA_COLUMNS,UPDATE_DATA_COLUMNS,)-from metagpt.prompts.ci.write_analysis_code import CODE_GENERATOR_WITH_TOOLS+from metagpt.prompts.mi.write_analysis_code import CODE_GENERATOR_WITH_TOOLSfrom metagpt.schema import Message, Planfrom metagpt.utils.common import create_func_call_config, remove_commentsdiff --git a/metagpt/actions/ci/write_analysis_code.py b/metagpt/actions/mi/write_analysis_code.pysimilarity index 99%rename from metagpt/actions/ci/write_analysis_code.pyrename to metagpt/actions/mi/write_analysis_code.pyindex 421eb0804..b3d0632b6 100644--- a/metagpt/actions/ci/write_analysis_code.py+++ b/metagpt/actions/mi/write_analysis_code.py@@ -10,7 +10,7 @@ from typing import Tuplefrom metagpt.actions import Actionfrom metagpt.logs import logger-from metagpt.prompts.ci.write_analysis_code import (+from metagpt.prompts.mi.write_analysis_code import (CODE_GENERATOR_WITH_TOOLS,SELECT_FUNCTION_TOOLS,TOOL_RECOMMENDATION_PROMPT,diff --git a/metagpt/actions/ci/write_plan.py b/metagpt/actions/mi/write_plan.pysimilarity index 98%rename from metagpt/actions/ci/write_plan.pyrename to metagpt/actions/mi/write_plan.pyindex dd9363260..8067d7b87 100644--- a/metagpt/actions/ci/write_plan.py+++ b/metagpt/actions/mi/write_plan.py@@ -12,7 +12,7 @@ from typing import Tuplefrom metagpt.actions import Actionfrom metagpt.logs import logger-from metagpt.prompts.ci.write_analysis_code import (+from metagpt.prompts.mi.write_analysis_code import (ASSIGN_TASK_TYPE_CONFIG,ASSIGN_TASK_TYPE_PROMPT,)diff --git a/metagpt/prompts/ci/__init__.py b/metagpt/prompts/mi/__init__.pysimilarity index 100%rename from metagpt/prompts/ci/__init__.pyrename to metagpt/prompts/mi/__init__.pydiff --git a/metagpt/prompts/ci/ml_action.py b/metagpt/prompts/mi/ml_action.pysimilarity index 100%rename from metagpt/prompts/ci/ml_action.pyrename to metagpt/prompts/mi/ml_action.pydiff --git a/metagpt/prompts/ci/write_analysis_code.py b/metagpt/prompts/mi/write_analysis_code.pysimilarity index 100%rename from metagpt/prompts/ci/write_analysis_code.pyrename to metagpt/prompts/mi/write_analysis_code.pydiff --git a/metagpt/roles/ci/__init__.py b/metagpt/roles/mi/__init__.pysimilarity index 100%rename from metagpt/roles/ci/__init__.pyrename to metagpt/roles/mi/__init__.pydiff --git a/metagpt/roles/ci/code_interpreter.py b/metagpt/roles/mi/interpreter.pysimilarity index 91%rename from metagpt/roles/ci/code_interpreter.pyrename to metagpt/roles/mi/interpreter.pyindex 404c93b81..fa50098e9 100644--- a/metagpt/roles/ci/code_interpreter.py+++ b/metagpt/roles/mi/interpreter.py@@ -2,9 +2,9 @@ from __future__ import annotationsfrom pydantic import Field-from metagpt.actions.ci.ask_review import ReviewConst-from metagpt.actions.ci.execute_nb_code import ExecuteNbCode-from metagpt.actions.ci.write_analysis_code import (+from metagpt.actions.mi.ask_review import ReviewConst+from metagpt.actions.mi.execute_nb_code import ExecuteNbCode+from metagpt.actions.mi.write_analysis_code import (WriteCodeWithoutTools,WriteCodeWithTools,)@@ -13,9 +13,9 @@ from metagpt.roles import Rolefrom metagpt.schema import Message, Task, TaskResult-class CodeInterpreter(Role):- name: str = "Charlie"- profile: str = "CodeInterpreter"+class Interpreter(Role):+ name: str = "Ivy"+ profile: str = "Interpreter"auto_run: bool = Trueuse_tools: bool = Falseexecute_code: ExecuteNbCode = Field(default_factory=ExecuteNbCode, exclude=True)diff --git a/metagpt/roles/ci/ml_engineer.py b/metagpt/roles/mi/ml_engineer.pysimilarity index 89%rename from metagpt/roles/ci/ml_engineer.pyrename to metagpt/roles/mi/ml_engineer.pyindex f8bcb2c89..78d605d3e 100644--- a/metagpt/roles/ci/ml_engineer.py+++ b/metagpt/roles/mi/ml_engineer.py@@ -1,13 +1,13 @@-from metagpt.actions.ci.debug_code import DebugCode-from metagpt.actions.ci.execute_nb_code import ExecuteNbCode-from metagpt.actions.ci.ml_action import UpdateDataColumns, WriteCodeWithToolsML+from metagpt.actions.mi.debug_code import DebugCode+from metagpt.actions.mi.execute_nb_code import ExecuteNbCode+from metagpt.actions.mi.ml_action import UpdateDataColumns, WriteCodeWithToolsMLfrom metagpt.logs import logger-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreterfrom metagpt.tools.tool_type import ToolTypefrom metagpt.utils.common import any_to_str-class MLEngineer(CodeInterpreter):+class MLEngineer(Interpreter):name: str = "Mark"profile: str = "MLEngineer"debug_context: list = []diff --git a/metagpt/strategy/planner.py b/metagpt/strategy/planner.pyindex fd635df39..851d45893 100644--- a/metagpt/strategy/planner.py+++ b/metagpt/strategy/planner.py@@ -4,8 +4,8 @@ import jsonfrom pydantic import BaseModel, Field-from metagpt.actions.ci.ask_review import AskReview, ReviewConst-from metagpt.actions.ci.write_plan import (+from metagpt.actions.mi.ask_review import AskReview, ReviewConst+from metagpt.actions.mi.write_plan import (WritePlan,precheck_update_plan_from_rsp,update_plan_from_rsp,diff --git a/metagpt/strategy/solver.py b/metagpt/strategy/solver.pyindex e7d61a881..ab16d82bd 100644--- a/metagpt/strategy/solver.py+++ b/metagpt/strategy/solver.py@@ -49,8 +49,8 @@ class TOTSolver(BaseSolver):raise NotImplementedError-class CodeInterpreterSolver(BaseSolver):- """CodeInterpreterSolver: Write&Run code in the graph"""+class InterpreterSolver(BaseSolver):+ """InterpreterSolver: Write&Run code in the graph"""async def solve(self):raise NotImplementedErrordiff --git a/tests/metagpt/actions/ci/test_ask_review.py b/tests/metagpt/actions/mi/test_ask_review.pysimilarity index 84%rename from tests/metagpt/actions/ci/test_ask_review.pyrename to tests/metagpt/actions/mi/test_ask_review.pyindex 4f02fe10b..92e8bd046 100644--- a/tests/metagpt/actions/ci/test_ask_review.py+++ b/tests/metagpt/actions/mi/test_ask_review.py@@ -1,6 +1,6 @@import pytest-from metagpt.actions.ci.ask_review import AskReview+from metagpt.actions.mi.ask_review import AskReview@pytest.mark.asynciodiff --git a/tests/metagpt/actions/ci/test_debug_code.py b/tests/metagpt/actions/mi/test_debug_code.pysimilarity index 96%rename from tests/metagpt/actions/ci/test_debug_code.pyrename to tests/metagpt/actions/mi/test_debug_code.pyindex 0307ac17e..24cfcef10 100644--- a/tests/metagpt/actions/ci/test_debug_code.py+++ b/tests/metagpt/actions/mi/test_debug_code.py@@ -5,7 +5,7 @@import pytest-from metagpt.actions.ci.debug_code import DebugCode+from metagpt.actions.mi.debug_code import DebugCodefrom metagpt.schema import MessageErrorStr = """Tested passed:diff --git a/tests/metagpt/actions/ci/test_execute_nb_code.py b/tests/metagpt/actions/mi/test_execute_nb_code.pysimilarity index 98%rename from tests/metagpt/actions/ci/test_execute_nb_code.pyrename to tests/metagpt/actions/mi/test_execute_nb_code.pyindex 72a85dd08..59a814054 100644--- a/tests/metagpt/actions/ci/test_execute_nb_code.py+++ b/tests/metagpt/actions/mi/test_execute_nb_code.py@@ -1,6 +1,6 @@import pytest-from metagpt.actions.ci.execute_nb_code import ExecuteNbCode, truncate+from metagpt.actions.mi.execute_nb_code import ExecuteNbCode, truncate@pytest.mark.asynciodiff --git a/tests/metagpt/actions/ci/test_ml_action.py b/tests/metagpt/actions/mi/test_ml_action.pysimilarity index 95%rename from tests/metagpt/actions/ci/test_ml_action.pyrename to tests/metagpt/actions/mi/test_ml_action.pyindex 5d9507094..27d47b0e3 100644--- a/tests/metagpt/actions/ci/test_ml_action.py+++ b/tests/metagpt/actions/mi/test_ml_action.py@@ -1,6 +1,6 @@import pytest-from metagpt.actions.ci.ml_action import WriteCodeWithToolsML+from metagpt.actions.mi.ml_action import WriteCodeWithToolsMLfrom metagpt.schema import Plan, Taskdiff --git a/tests/metagpt/actions/ci/test_write_analysis_code.py b/tests/metagpt/actions/mi/test_write_analysis_code.pysimilarity index 99%rename from tests/metagpt/actions/ci/test_write_analysis_code.pyrename to tests/metagpt/actions/mi/test_write_analysis_code.pyindex 95c7dfca8..6c2228222 100644--- a/tests/metagpt/actions/ci/test_write_analysis_code.py+++ b/tests/metagpt/actions/mi/test_write_analysis_code.py@@ -2,8 +2,8 @@ import asyncioimport pytest-from metagpt.actions.ci.execute_nb_code import ExecuteNbCode-from metagpt.actions.ci.write_analysis_code import (+from metagpt.actions.mi.execute_nb_code import ExecuteNbCode+from metagpt.actions.mi.write_analysis_code import (WriteCodeWithoutTools,WriteCodeWithTools,)diff --git a/tests/metagpt/actions/ci/test_write_plan.py b/tests/metagpt/actions/mi/test_write_plan.pysimilarity index 95%rename from tests/metagpt/actions/ci/test_write_plan.pyrename to tests/metagpt/actions/mi/test_write_plan.pyindex 3eb80ca3e..97632ea44 100644--- a/tests/metagpt/actions/ci/test_write_plan.py+++ b/tests/metagpt/actions/mi/test_write_plan.py@@ -1,6 +1,6 @@import pytest-from metagpt.actions.ci.write_plan import (+from metagpt.actions.mi.write_plan import (Plan,Task,WritePlan,diff --git a/tests/metagpt/roles/ci/test_code_interpreter.py b/tests/metagpt/roles/mi/test_interpreter.pysimilarity index 59%rename from tests/metagpt/roles/ci/test_code_interpreter.pyrename to tests/metagpt/roles/mi/test_interpreter.pyindex 9d2f2429b..3bae4a1ac 100644--- a/tests/metagpt/roles/ci/test_code_interpreter.py+++ b/tests/metagpt/roles/mi/test_interpreter.py@@ -1,23 +1,23 @@import pytestfrom metagpt.logs import logger-from metagpt.roles.ci.code_interpreter import CodeInterpreter+from metagpt.roles.mi.interpreter import Interpreter@pytest.mark.asyncio@pytest.mark.parametrize("auto_run", [(True), (False)])-async def test_code_interpreter(mocker, auto_run):- mocker.patch("metagpt.actions.ci.execute_nb_code.ExecuteNbCode.run", return_value=("a successful run", True))+async def test_interpreter(mocker, auto_run):+ mocker.patch("metagpt.actions.mi.execute_nb_code.ExecuteNbCode.run", return_value=("a successful run", True))mocker.patch("builtins.input", return_value="confirm")requirement = "Run data analysis on sklearn Iris dataset, include a plot"tools = []- ci = CodeInterpreter(auto_run=auto_run, use_tools=True, tools=tools)- rsp = await ci.run(requirement)+ mi = Interpreter(auto_run=auto_run, use_tools=True, tools=tools)+ rsp = await mi.run(requirement)logger.info(rsp)assert len(rsp.content) > 0- finished_tasks = ci.planner.plan.get_finished_tasks()+ finished_tasks = mi.planner.plan.get_finished_tasks()assert len(finished_tasks) > 0assert len(finished_tasks[0].code) > 0 # check one task to see if code is recordeddiff --git a/tests/metagpt/roles/ci/test_ml_engineer.py b/tests/metagpt/roles/mi/test_ml_engineer.pysimilarity index 91%rename from tests/metagpt/roles/ci/test_ml_engineer.pyrename to tests/metagpt/roles/mi/test_ml_engineer.pyindex 3bf9f3b92..921ac8822 100644--- a/tests/metagpt/roles/ci/test_ml_engineer.py+++ b/tests/metagpt/roles/mi/test_ml_engineer.py@@ -1,16 +1,16 @@import pytest-from metagpt.actions.ci.execute_nb_code import ExecuteNbCode+from metagpt.actions.mi.execute_nb_code import ExecuteNbCodefrom metagpt.logs import logger-from metagpt.roles.ci.ml_engineer import MLEngineer+from metagpt.roles.mi.ml_engineer import MLEngineerfrom metagpt.schema import Message, Plan, Taskfrom metagpt.tools.tool_type import ToolType-from tests.metagpt.actions.ci.test_debug_code import CODE, DebugContext, ErrorStr+from tests.metagpt.actions.mi.test_debug_code import CODE, DebugContext, ErrorStrdef test_mle_init():- ci = MLEngineer(goal="test", auto_run=True, use_tools=True, tools=["tool1", "tool2"])- assert ci.tools == []+ mle = MLEngineer(goal="test", auto_run=True, use_tools=True, tools=["tool1", "tool2"])+ assert mle.tools == []MockPlan = Plan(diff --git a/tests/metagpt/utils/test_save_code.py b/tests/metagpt/utils/test_save_code.pyindex 35ad84baf..9df2650f3 100644--- a/tests/metagpt/utils/test_save_code.py+++ b/tests/metagpt/utils/test_save_code.py@@ -6,7 +6,7 @@import nbformatimport pytest-from metagpt.actions.ci.execute_nb_code import ExecuteNbCode+from metagpt.actions.mi.execute_nb_code import ExecuteNbCodefrom metagpt.utils.common import read_json_filefrom metagpt.utils.save_code import DATA_PATH, save_code_file