Skip to content

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

refine code

lidanyang7ea23a48e4c8
diff --git a/metagpt/strategy/planner.py b/metagpt/strategy/planner.py
index c54f6be15..1b4b1cca9 100644
--- a/metagpt/strategy/planner.py
+++ b/metagpt/strategy/planner.py
@@ -169,6 +169,7 @@ class Planner(BaseModel):
def get_plan_status(self, exclude: List[str] = None) -> str:
# prepare components of a plan status
exclude = exclude or []
+ exclude_prompt = "omit here"
finished_tasks = self.plan.get_finished_tasks()
code_written = [remove_comments(task.code) for task in finished_tasks]
code_written = "\n\n".join(code_written)
@@ -180,11 +181,11 @@ class Planner(BaseModel):
# combine components in a prompt
prompt = PLAN_STATUS.format(
- code_written=code_written if "code" not in exclude else "omit here",
- task_results=task_results if "task_result" not in exclude else "omit here",
+ code_written=code_written if "code" not in exclude else exclude_prompt,
+ task_results=task_results if "task_result" not in exclude else exclude_prompt,
current_task=self.current_task.instruction,
- current_task_code=self.current_task.code if "code" not in exclude else "omit here",
- current_task_result=self.current_task.result if "task_result" not in exclude else "omit here",
+ current_task_code=self.current_task.code if "code" not in exclude else exclude_prompt,
+ current_task_result=self.current_task.result if "task_result" not in exclude else exclude_prompt,
guidance=guidance,
)