🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
log plan
yzlin95dc1eebf201
diff --git a/metagpt/logs.py b/metagpt/logs.pyindex e134afca3..e547ebb76 100644--- a/metagpt/logs.py+++ b/metagpt/logs.py@@ -38,7 +38,7 @@ def log_llm_stream(msg):def log_tool_output(output: dict, tool_name: str = ""):"""interface for logging tool output, can be set to log tool output in different ways to different places with set_tool_output_logfunc"""- _tool_output_log(output)+ _tool_output_log(output, tool_name)def set_llm_stream_logfunc(func):diff --git a/metagpt/schema.py b/metagpt/schema.pyindex 45c7480f9..d944a4199 100644--- a/metagpt/schema.py+++ b/metagpt/schema.py@@ -45,7 +45,7 @@ from metagpt.const import (SYSTEM_DESIGN_FILE_REPO,TASK_FILE_REPO,)-from metagpt.logs import logger+from metagpt.logs import log_tool_output, loggerfrom metagpt.repo_parser import DotClassInfofrom metagpt.utils.common import any_to_str, any_to_str_set, import_classfrom metagpt.utils.exceptions import handle_exception@@ -433,6 +433,11 @@ class Plan(BaseModel):final_tasks = self.tasks[:prefix_length] + new_tasks[prefix_length:]self.tasks = final_tasks+ log_tool_output(+ {"output": "\n\n".join([f"Task {task.task_id}: {task.instruction}" for task in self.tasks])},+ tool_name="Plan",+ )+# Update current_task_id to the first unfinished task in the merged listself._update_current_task()