From 1973af16339aa6d8d9cac13097d6949fe7e4b7e2 Mon Sep 17 00:00:00 2001 From: lidanyang Date: Fri, 19 Jul 2024 17:06:38 +0800 Subject: [PATCH] add task desc to write code --- metagpt/roles/di/data_analyst.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/metagpt/roles/di/data_analyst.py b/metagpt/roles/di/data_analyst.py index 694e42de3..b16e9690c 100644 --- a/metagpt/roles/di/data_analyst.py +++ b/metagpt/roles/di/data_analyst.py @@ -60,14 +60,19 @@ class DataAnalyst(RoleZero): self.rc.working_memory.add(Message(content=browser_actions, role="user", cause_by="browser")) return memory - async def write_and_exec_code(self): - """Write a code block for current task and execute it in an interactive notebook environment.""" + async def write_and_exec_code(self, task_desc: str): + """Write a code block for current task and execute it in an interactive notebook environment. + + Args: + task_desc (str): The task description for which the code needs to be written. + """ counter = 0 success = False await self.execute_code.init_code() # plan info plan_status = self.planner.get_plan_status() + plan_status = plan_status + f"\nSpecific Task Description:{task_desc}" # tool info if self.custom_tool_recommender: