diff --git a/examples/mi/machine_learning.py b/examples/mi/machine_learning.py index ee3b47f26..a8ab5051e 100644 --- a/examples/mi/machine_learning.py +++ b/examples/mi/machine_learning.py @@ -1,13 +1,13 @@ -import asyncio +import fire from metagpt.roles.mi.interpreter import Interpreter -async def main(requirement: str): - mi = Interpreter(auto_run=True, use_tools=False) +async 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) 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)) + fire.Fire(main) diff --git a/metagpt/strategy/planner.py b/metagpt/strategy/planner.py index 851d45893..99d16f78b 100644 --- a/metagpt/strategy/planner.py +++ b/metagpt/strategy/planner.py @@ -122,7 +122,7 @@ class Planner(BaseModel): ) # "confirm, ... (more content, such as changing downstream tasks)" if confirmed_and_more: self.working_memory.add(Message(content=review, role="user", cause_by=AskReview)) - await self.update_plan(review) + await self.update_plan() def get_useful_memories(self, task_exclude_field=None) -> list[Message]: """find useful memories only to reduce context length and improve performance"""