Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

add ml example

yzlin74c5807d0111
diff --git a/examples/ci/machine_learning.py b/examples/ci/machine_learning.py
index e69de29bb..9eda981ac 100644
--- a/examples/ci/machine_learning.py
+++ b/examples/ci/machine_learning.py
@@ -0,0 +1,13 @@
+import asyncio
+
+from metagpt.roles.ci.code_interpreter import CodeInterpreter
+
+
+async def main(requirement: str):
+ role = CodeInterpreter(auto_run=True, use_tools=False)
+ await role.run(requirement)
+
+
+if __name__ == "__main__":
+ 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."
+ asyncio.run(main(requirement))
diff --git a/examples/ci/ml_engineer_with_tools.py b/examples/ci/ml_engineer_with_tools.py
index 1c73a1dd0..66d37316b 100644
--- a/examples/ci/ml_engineer_with_tools.py
+++ b/examples/ci/ml_engineer_with_tools.py
@@ -3,8 +3,8 @@ import asyncio
from metagpt.roles.ci.ml_engineer import MLEngineer
-async def main(requirement: str, auto_run: bool = True, use_tools: bool = True):
- role = MLEngineer(goal=requirement, auto_run=auto_run, use_tools=use_tools)
+async def main(requirement: str):
+ role = MLEngineer(auto_run=True, use_tools=True)
await role.run(requirement)