π The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
rename interpreter
yzlin0a01bdec6a30
diff --git a/README.md b/README.mdindex 4e2c3280d..72ce03412 100644--- a/README.md+++ b/README.md@@ -26,7 +26,9 @@</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 [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.+π March. 01, 2024: Our Data Interpreter paper is on arxiv. Find all design and benchmark details [here](https://arxiv.org/abs/2402.18679)!++π 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 [Data Interpreter](https://github.com/geekan/MetaGPT/blob/main/examples/di/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/di/README.md b/examples/di/README.mdnew file mode 100644index 000000000..fb4e8044b--- /dev/null+++ b/examples/di/README.md@@ -0,0 +1,18 @@+# Data Interpreter (DI)++## What is Data Interpreter+Data 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/intro.html) for detailed explanation.\ No newline at end of filediff --git a/examples/mi/crawl_webpage.py b/examples/di/crawl_webpage.pysimilarity index 78%rename from examples/mi/crawl_webpage.pyrename to examples/di/crawl_webpage.pyindex b5d2fb3d0..f06b85d9b 100644--- a/examples/mi/crawl_webpage.py+++ b/examples/di/crawl_webpage.py@@ -5,15 +5,15 @@@File : crawl_webpage.py"""-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreterasync 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*"""- mi = Interpreter(use_tools=True)+ di = DataInterpreter(use_tools=True)- await mi.run(prompt)+ await di.run(prompt)if __name__ == "__main__":diff --git a/examples/mi/data_visualization.py b/examples/di/data_visualization.pysimilarity index 59%rename from examples/mi/data_visualization.pyrename to examples/di/data_visualization.pyindex 2e4acc9b4..9af72dc42 100644--- a/examples/mi/data_visualization.py+++ b/examples/di/data_visualization.py@@ -1,11 +1,11 @@import asyncio-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreterasync def main(requirement: str = ""):- mi = Interpreter(use_tools=False)- await mi.run(requirement)+ di = DataInterpreter(use_tools=False)+ await di.run(requirement)if __name__ == "__main__":diff --git a/examples/mi/email_summary.py b/examples/di/email_summary.pysimilarity index 90%rename from examples/mi/email_summary.pyrename to examples/di/email_summary.pyindex e1511c5b0..af081fee2 100644--- a/examples/mi/email_summary.py+++ b/examples/di/email_summary.py@@ -6,7 +6,7 @@"""import os-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreterasync 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."""- mi = Interpreter(use_tools=True)+ di = DataInterpreter(use_tools=True)- await mi.run(prompt)+ await di.run(prompt)if __name__ == "__main__":diff --git a/examples/mi/imitate_webpage.py b/examples/di/imitate_webpage.pysimilarity index 81%rename from examples/mi/imitate_webpage.pyrename to examples/di/imitate_webpage.pyindex 0e9ca731d..e2c99b874 100644--- a/examples/mi/imitate_webpage.py+++ b/examples/di/imitate_webpage.py@@ -5,7 +5,7 @@@Author : mannaandpoem@File : imitate_webpage.py"""-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreterasync 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."""- mi = Interpreter(use_tools=True)+ di = DataInterpreter(use_tools=True)- await mi.run(prompt)+ await di.run(prompt)if __name__ == "__main__":diff --git a/examples/mi/machine_learning.py b/examples/di/machine_learning.pysimilarity index 67%rename from examples/mi/machine_learning.pyrename to examples/di/machine_learning.pyindex a8ab5051e..a58735831 100644--- a/examples/mi/machine_learning.py+++ b/examples/di/machine_learning.py@@ -1,12 +1,12 @@import fire-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreterasync def main(auto_run: bool = True):requirement = "Run data analysis on sklearn Wine recognition dataset, include a plot, and train a model to predict wine class (20% as validation), and show validation accuracy."- mi = Interpreter(auto_run=auto_run)- await mi.run(requirement)+ di = DataInterpreter(auto_run=auto_run)+ await di.run(requirement)if __name__ == "__main__":diff --git a/examples/mi/ml_engineer_with_tools.py b/examples/di/ml_engineer_with_tools.pysimilarity index 94%rename from examples/mi/ml_engineer_with_tools.pyrename to examples/di/ml_engineer_with_tools.pyindex 9d0e7f951..6119ad843 100644--- a/examples/mi/ml_engineer_with_tools.py+++ b/examples/di/ml_engineer_with_tools.py@@ -1,6 +1,6 @@import asyncio-from metagpt.roles.mi.ml_engineer import MLEngineer+from metagpt.roles.di.ml_engineer import MLEngineerasync def main(requirement: str):diff --git a/examples/mi/ocr_receipt.py b/examples/di/ocr_receipt.pysimilarity index 84%rename from examples/mi/ocr_receipt.pyrename to examples/di/ocr_receipt.pyindex f394cccec..af54d519b 100644--- a/examples/mi/ocr_receipt.py+++ b/examples/di/ocr_receipt.py@@ -1,4 +1,4 @@-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreterasync def main():@@ -10,9 +10,9 @@ async def main():coordinates and confidence levels, then recognize the total amount from ocr text content, and finally save as table.Image path: {image_path}.NOTE: The environments for Paddle and PaddleOCR are all ready and has been fully installed."""- mi = Interpreter()+ di = DataInterpreter()- await mi.run(requirement)+ await di.run(requirement)if __name__ == "__main__":diff --git a/examples/mi/rm_image_background.py b/examples/di/rm_image_background.pysimilarity index 75%rename from examples/mi/rm_image_background.pyrename to examples/di/rm_image_background.pyindex 57e89b103..b74a79eeb 100644--- a/examples/mi/rm_image_background.py+++ b/examples/di/rm_image_background.py@@ -1,11 +1,11 @@import asyncio-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreterasync def main(requirement: str = ""):- mi = Interpreter(use_tools=False)- await mi.run(requirement)+ di = DataInterpreter(use_tools=False)+ await di.run(requirement)if __name__ == "__main__":diff --git a/examples/mi/sd_tool_usage.py b/examples/di/sd_tool_usage.pysimilarity index 73%rename from examples/mi/sd_tool_usage.pyrename to examples/di/sd_tool_usage.pyindex f8507a411..69c7df5bd 100644--- a/examples/mi/sd_tool_usage.py+++ b/examples/di/sd_tool_usage.py@@ -4,12 +4,12 @@# @Desc :import asyncio-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreterasync def main(requirement: str = ""):- mi = Interpreter(use_tools=True, goal=requirement)- await mi.run(requirement)+ di = DataInterpreter(use_tools=True, goal=requirement)+ await di.run(requirement)if __name__ == "__main__":diff --git a/examples/mi/solve_math_problems.py b/examples/di/solve_math_problems.pysimilarity index 70%rename from examples/mi/solve_math_problems.pyrename to examples/di/solve_math_problems.pyindex dce2edb00..35a69c953 100644--- a/examples/mi/solve_math_problems.py+++ b/examples/di/solve_math_problems.py@@ -1,11 +1,11 @@import asyncio-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreterasync def main(requirement: str = ""):- mi = Interpreter(use_tools=False)- await mi.run(requirement)+ di = DataInterpreter(use_tools=False)+ await di.run(requirement)if __name__ == "__main__":diff --git a/examples/mi/README.md b/examples/mi/README.mddeleted file mode 100644index 1734ba388..000000000--- a/examples/mi/README.md+++ /dev/null@@ -1,18 +0,0 @@-# 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/metagpt/actions/__init__.py b/metagpt/actions/__init__.pyindex 19a7c10d5..29af1dad1 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.mi.execute_nb_code import ExecuteNbCode-from metagpt.actions.mi.write_analysis_code import WriteCodeWithoutTools, WriteCodeWithTools-from metagpt.actions.mi.write_plan import WritePlan+from metagpt.actions.di.execute_nb_code import ExecuteNbCode+from metagpt.actions.di.write_analysis_code import WriteCodeWithoutTools, WriteCodeWithTools+from metagpt.actions.di.write_plan import WritePlanclass ActionType(Enum):diff --git a/metagpt/actions/mi/__init__.py b/metagpt/actions/di/__init__.pysimilarity index 100%rename from metagpt/actions/mi/__init__.pyrename to metagpt/actions/di/__init__.pydiff --git a/metagpt/actions/mi/ask_review.py b/metagpt/actions/di/ask_review.pysimilarity index 100%rename from metagpt/actions/mi/ask_review.pyrename to metagpt/actions/di/ask_review.pydiff --git a/metagpt/actions/mi/debug_code.py b/metagpt/actions/di/debug_code.pysimilarity index 98%rename from metagpt/actions/mi/debug_code.pyrename to metagpt/actions/di/debug_code.pyindex db3b7a9db..f589436f5 100644--- a/metagpt/actions/mi/debug_code.py+++ b/metagpt/actions/di/debug_code.py@@ -1,6 +1,6 @@from __future__ import annotations-from metagpt.actions.mi.write_analysis_code import BaseWriteAnalysisCode+from metagpt.actions.di.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/mi/execute_nb_code.py b/metagpt/actions/di/execute_nb_code.pysimilarity index 100%rename from metagpt/actions/mi/execute_nb_code.pyrename to metagpt/actions/di/execute_nb_code.pydiff --git a/metagpt/actions/mi/ml_action.py b/metagpt/actions/di/ml_action.pysimilarity index 93%rename from metagpt/actions/mi/ml_action.pyrename to metagpt/actions/di/ml_action.pyindex 60b2fb547..d49b7b67d 100644--- a/metagpt/actions/mi/ml_action.py+++ b/metagpt/actions/di/ml_action.py@@ -3,14 +3,14 @@ from __future__ import annotationsfrom typing import Tuplefrom metagpt.actions import Action-from metagpt.actions.mi.write_analysis_code import WriteCodeWithTools-from metagpt.prompts.mi.ml_action import (+from metagpt.actions.di.write_analysis_code import WriteCodeWithTools+from metagpt.prompts.di.ml_action import (ML_GENERATE_CODE_PROMPT,ML_TOOL_USAGE_PROMPT,PRINT_DATA_COLUMNS,UPDATE_DATA_COLUMNS,)-from metagpt.prompts.mi.write_analysis_code import CODE_GENERATOR_WITH_TOOLS+from metagpt.prompts.di.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/mi/write_analysis_code.py b/metagpt/actions/di/write_analysis_code.pysimilarity index 99%rename from metagpt/actions/mi/write_analysis_code.pyrename to metagpt/actions/di/write_analysis_code.pyindex b3d0632b6..0c4980c2b 100644--- a/metagpt/actions/mi/write_analysis_code.py+++ b/metagpt/actions/di/write_analysis_code.py@@ -10,7 +10,7 @@ from typing import Tuplefrom metagpt.actions import Actionfrom metagpt.logs import logger-from metagpt.prompts.mi.write_analysis_code import (+from metagpt.prompts.di.write_analysis_code import (CODE_GENERATOR_WITH_TOOLS,SELECT_FUNCTION_TOOLS,TOOL_RECOMMENDATION_PROMPT,diff --git a/metagpt/actions/mi/write_plan.py b/metagpt/actions/di/write_plan.pysimilarity index 98%rename from metagpt/actions/mi/write_plan.pyrename to metagpt/actions/di/write_plan.pyindex 8067d7b87..518dfb6c6 100644--- a/metagpt/actions/mi/write_plan.py+++ b/metagpt/actions/di/write_plan.py@@ -12,7 +12,7 @@ from typing import Tuplefrom metagpt.actions import Actionfrom metagpt.logs import logger-from metagpt.prompts.mi.write_analysis_code import (+from metagpt.prompts.di.write_analysis_code import (ASSIGN_TASK_TYPE_CONFIG,ASSIGN_TASK_TYPE_PROMPT,)diff --git a/metagpt/prompts/mi/__init__.py b/metagpt/prompts/di/__init__.pysimilarity index 100%rename from metagpt/prompts/mi/__init__.pyrename to metagpt/prompts/di/__init__.pydiff --git a/metagpt/prompts/mi/ml_action.py b/metagpt/prompts/di/ml_action.pysimilarity index 100%rename from metagpt/prompts/mi/ml_action.pyrename to metagpt/prompts/di/ml_action.pydiff --git a/metagpt/prompts/mi/write_analysis_code.py b/metagpt/prompts/di/write_analysis_code.pysimilarity index 100%rename from metagpt/prompts/mi/write_analysis_code.pyrename to metagpt/prompts/di/write_analysis_code.pydiff --git a/metagpt/roles/mi/__init__.py b/metagpt/roles/di/__init__.pysimilarity index 100%rename from metagpt/roles/mi/__init__.pyrename to metagpt/roles/di/__init__.pydiff --git a/metagpt/roles/mi/interpreter.py b/metagpt/roles/di/data_interpreter.pysimilarity index 91%rename from metagpt/roles/mi/interpreter.pyrename to metagpt/roles/di/data_interpreter.pyindex fa50098e9..b3a2e789f 100644--- a/metagpt/roles/mi/interpreter.py+++ b/metagpt/roles/di/data_interpreter.py@@ -2,9 +2,9 @@ from __future__ import annotationsfrom pydantic import Field-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 (+from metagpt.actions.di.ask_review import ReviewConst+from metagpt.actions.di.execute_nb_code import ExecuteNbCode+from metagpt.actions.di.write_analysis_code import (WriteCodeWithoutTools,WriteCodeWithTools,)@@ -13,9 +13,9 @@ from metagpt.roles import Rolefrom metagpt.schema import Message, Task, TaskResult-class Interpreter(Role):- name: str = "Ivy"- profile: str = "Interpreter"+class DataInterpreter(Role):+ name: str = "David"+ profile: str = "DataInterpreter"auto_run: bool = Trueuse_tools: bool = Falseexecute_code: ExecuteNbCode = Field(default_factory=ExecuteNbCode, exclude=True)diff --git a/metagpt/roles/mi/ml_engineer.py b/metagpt/roles/di/ml_engineer.pysimilarity index 89%rename from metagpt/roles/mi/ml_engineer.pyrename to metagpt/roles/di/ml_engineer.pyindex 78d605d3e..b33b166cf 100644--- a/metagpt/roles/mi/ml_engineer.py+++ b/metagpt/roles/di/ml_engineer.py@@ -1,13 +1,13 @@-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, WriteCodeWithToolsML+from metagpt.actions.di.debug_code import DebugCode+from metagpt.actions.di.execute_nb_code import ExecuteNbCode+from metagpt.actions.di.ml_action import UpdateDataColumns, WriteCodeWithToolsMLfrom metagpt.logs import logger-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreterfrom metagpt.tools.tool_type import ToolTypefrom metagpt.utils.common import any_to_str-class MLEngineer(Interpreter):+class MLEngineer(DataInterpreter):name: str = "Mark"profile: str = "MLEngineer"debug_context: list = []diff --git a/metagpt/strategy/planner.py b/metagpt/strategy/planner.pyindex 99d16f78b..44294be00 100644--- a/metagpt/strategy/planner.py+++ b/metagpt/strategy/planner.py@@ -4,8 +4,8 @@ import jsonfrom pydantic import BaseModel, Field-from metagpt.actions.mi.ask_review import AskReview, ReviewConst-from metagpt.actions.mi.write_plan import (+from metagpt.actions.di.ask_review import AskReview, ReviewConst+from metagpt.actions.di.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 ab16d82bd..e532f736b 100644--- a/metagpt/strategy/solver.py+++ b/metagpt/strategy/solver.py@@ -49,8 +49,8 @@ class TOTSolver(BaseSolver):raise NotImplementedError-class InterpreterSolver(BaseSolver):- """InterpreterSolver: Write&Run code in the graph"""+class DataInterpreterSolver(BaseSolver):+ """DataInterpreterSolver: Write&Run code in the graph"""async def solve(self):raise NotImplementedErrordiff --git a/setup.py b/setup.pyindex ed3d5f78f..2044e577a 100644--- a/setup.py+++ b/setup.py@@ -57,7 +57,7 @@ extras_require["dev"] = (["pylint~=3.0.3", "black~=23.3.0", "isort~=5.12.0", "prsetup(name="metagpt",- version="0.7.2",+ version="0.7.4",description="The Multi-Agent Framework",long_description=long_description,long_description_content_type="text/markdown",diff --git a/tests/metagpt/actions/mi/test_ask_review.py b/tests/metagpt/actions/di/test_ask_review.pysimilarity index 84%rename from tests/metagpt/actions/mi/test_ask_review.pyrename to tests/metagpt/actions/di/test_ask_review.pyindex 92e8bd046..6bb1accf5 100644--- a/tests/metagpt/actions/mi/test_ask_review.py+++ b/tests/metagpt/actions/di/test_ask_review.py@@ -1,6 +1,6 @@import pytest-from metagpt.actions.mi.ask_review import AskReview+from metagpt.actions.di.ask_review import AskReview@pytest.mark.asynciodiff --git a/tests/metagpt/actions/mi/test_debug_code.py b/tests/metagpt/actions/di/test_debug_code.pysimilarity index 96%rename from tests/metagpt/actions/mi/test_debug_code.pyrename to tests/metagpt/actions/di/test_debug_code.pyindex 24cfcef10..67f72ad63 100644--- a/tests/metagpt/actions/mi/test_debug_code.py+++ b/tests/metagpt/actions/di/test_debug_code.py@@ -5,7 +5,7 @@import pytest-from metagpt.actions.mi.debug_code import DebugCode+from metagpt.actions.di.debug_code import DebugCodefrom metagpt.schema import MessageErrorStr = """Tested passed:diff --git a/tests/metagpt/actions/mi/test_execute_nb_code.py b/tests/metagpt/actions/di/test_execute_nb_code.pysimilarity index 98%rename from tests/metagpt/actions/mi/test_execute_nb_code.pyrename to tests/metagpt/actions/di/test_execute_nb_code.pyindex 59a814054..b491dd212 100644--- a/tests/metagpt/actions/mi/test_execute_nb_code.py+++ b/tests/metagpt/actions/di/test_execute_nb_code.py@@ -1,6 +1,6 @@import pytest-from metagpt.actions.mi.execute_nb_code import ExecuteNbCode, truncate+from metagpt.actions.di.execute_nb_code import ExecuteNbCode, truncate@pytest.mark.asynciodiff --git a/tests/metagpt/actions/mi/test_ml_action.py b/tests/metagpt/actions/di/test_ml_action.pysimilarity index 95%rename from tests/metagpt/actions/mi/test_ml_action.pyrename to tests/metagpt/actions/di/test_ml_action.pyindex 27d47b0e3..826a7fcf2 100644--- a/tests/metagpt/actions/mi/test_ml_action.py+++ b/tests/metagpt/actions/di/test_ml_action.py@@ -1,6 +1,6 @@import pytest-from metagpt.actions.mi.ml_action import WriteCodeWithToolsML+from metagpt.actions.di.ml_action import WriteCodeWithToolsMLfrom metagpt.schema import Plan, Taskdiff --git a/tests/metagpt/actions/mi/test_write_analysis_code.py b/tests/metagpt/actions/di/test_write_analysis_code.pysimilarity index 99%rename from tests/metagpt/actions/mi/test_write_analysis_code.pyrename to tests/metagpt/actions/di/test_write_analysis_code.pyindex 6c2228222..d6bbae1c6 100644--- a/tests/metagpt/actions/mi/test_write_analysis_code.py+++ b/tests/metagpt/actions/di/test_write_analysis_code.py@@ -2,8 +2,8 @@ import asyncioimport pytest-from metagpt.actions.mi.execute_nb_code import ExecuteNbCode-from metagpt.actions.mi.write_analysis_code import (+from metagpt.actions.di.execute_nb_code import ExecuteNbCode+from metagpt.actions.di.write_analysis_code import (WriteCodeWithoutTools,WriteCodeWithTools,)diff --git a/tests/metagpt/actions/mi/test_write_plan.py b/tests/metagpt/actions/di/test_write_plan.pysimilarity index 95%rename from tests/metagpt/actions/mi/test_write_plan.pyrename to tests/metagpt/actions/di/test_write_plan.pyindex 97632ea44..80b3399b8 100644--- a/tests/metagpt/actions/mi/test_write_plan.py+++ b/tests/metagpt/actions/di/test_write_plan.py@@ -1,6 +1,6 @@import pytest-from metagpt.actions.mi.write_plan import (+from metagpt.actions.di.write_plan import (Plan,Task,WritePlan,diff --git a/tests/metagpt/roles/mi/test_interpreter.py b/tests/metagpt/roles/di/test_data_interpreter.pysimilarity index 65%rename from tests/metagpt/roles/mi/test_interpreter.pyrename to tests/metagpt/roles/di/test_data_interpreter.pyindex 3bae4a1ac..ba50f473b 100644--- a/tests/metagpt/roles/mi/test_interpreter.py+++ b/tests/metagpt/roles/di/test_data_interpreter.py@@ -1,23 +1,23 @@import pytestfrom metagpt.logs import logger-from metagpt.roles.mi.interpreter import Interpreter+from metagpt.roles.di.data_interpreter import DataInterpreter@pytest.mark.asyncio@pytest.mark.parametrize("auto_run", [(True), (False)])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("metagpt.actions.di.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 = []- mi = Interpreter(auto_run=auto_run, use_tools=True, tools=tools)- rsp = await mi.run(requirement)+ di = DataInterpreter(auto_run=auto_run, use_tools=True, tools=tools)+ rsp = await di.run(requirement)logger.info(rsp)assert len(rsp.content) > 0- finished_tasks = mi.planner.plan.get_finished_tasks()+ finished_tasks = di.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/mi/test_ml_engineer.py b/tests/metagpt/roles/di/test_ml_engineer.pysimilarity index 94%rename from tests/metagpt/roles/mi/test_ml_engineer.pyrename to tests/metagpt/roles/di/test_ml_engineer.pyindex 921ac8822..08b92cd27 100644--- a/tests/metagpt/roles/mi/test_ml_engineer.py+++ b/tests/metagpt/roles/di/test_ml_engineer.py@@ -1,11 +1,11 @@import pytest-from metagpt.actions.mi.execute_nb_code import ExecuteNbCode+from metagpt.actions.di.execute_nb_code import ExecuteNbCodefrom metagpt.logs import logger-from metagpt.roles.mi.ml_engineer import MLEngineer+from metagpt.roles.di.ml_engineer import MLEngineerfrom metagpt.schema import Message, Plan, Taskfrom metagpt.tools.tool_type import ToolType-from tests.metagpt.actions.mi.test_debug_code import CODE, DebugContext, ErrorStr+from tests.metagpt.actions.di.test_debug_code import CODE, DebugContext, ErrorStrdef test_mle_init():diff --git a/tests/metagpt/utils/test_save_code.py b/tests/metagpt/utils/test_save_code.pyindex 9df2650f3..aceecec3b 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.mi.execute_nb_code import ExecuteNbCode+from metagpt.actions.di.execute_nb_code import ExecuteNbCodefrom metagpt.utils.common import read_json_filefrom metagpt.utils.save_code import DATA_PATH, save_code_file