From 4e6d1a00f87378a04465d43e81d248c7219447cf Mon Sep 17 00:00:00 2001 From: geekan Date: Tue, 19 Dec 2023 11:01:20 +0800 Subject: [PATCH] use pre-commit --- metagpt/actions/action_node.py | 12 ++++++++++-- metagpt/actions/project_management_an.py | 2 +- metagpt/roles/project_manager.py | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/metagpt/actions/action_node.py b/metagpt/actions/action_node.py index fb7d621d8..9bb12fc84 100644 --- a/metagpt/actions/action_node.py +++ b/metagpt/actions/action_node.py @@ -52,6 +52,7 @@ def dict_to_markdown(d, prefix="-", postfix="\n"): class ActionNode: """ActionNode is a tree of nodes.""" + mode: str # Action Context @@ -70,8 +71,15 @@ class ActionNode: content: str instruct_content: BaseModel - def __init__(self, key: str, expected_type: Type, instruction: str, example: str, content: str = "", - children: dict[str, "ActionNode"] = None): + def __init__( + self, + key: str, + expected_type: Type, + instruction: str, + example: str, + content: str = "", + children: dict[str, "ActionNode"] = None, + ): self.key = key self.expected_type = expected_type self.instruction = instruction diff --git a/metagpt/actions/project_management_an.py b/metagpt/actions/project_management_an.py index 970cb0594..6208c1051 100644 --- a/metagpt/actions/project_management_an.py +++ b/metagpt/actions/project_management_an.py @@ -44,7 +44,7 @@ FULL_API_SPEC = ActionNode( key="Full API spec", expected_type=str, instruction="Describe all APIs using OpenAPI 3.0 spec that may be used by both frontend and backend. If front-end " - "and back-end communication is not required, leave it blank.", + "and back-end communication is not required, leave it blank.", example="openapi: 3.0.0 ...", ) diff --git a/metagpt/roles/project_manager.py b/metagpt/roles/project_manager.py index f98d28cb7..42564cd70 100644 --- a/metagpt/roles/project_manager.py +++ b/metagpt/roles/project_manager.py @@ -30,5 +30,6 @@ class ProjectManager(Role): def __init__(self, **kwargs) -> None: super().__init__(**kwargs) + self._init_actions([WriteTasks]) self._watch([WriteDesign])