From f0edea65feb351b02110c5f9bde9a7f1eaee6781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Fri, 2 Aug 2024 12:26:08 +0800 Subject: [PATCH] fixbug: #1430 --- metagpt/actions/project_management.py | 2 +- metagpt/actions/project_management_an.py | 14 +++++++------- metagpt/actions/write_code_an_draft.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/metagpt/actions/project_management.py b/metagpt/actions/project_management.py index 67a614d6f..aede61a2e 100644 --- a/metagpt/actions/project_management.py +++ b/metagpt/actions/project_management.py @@ -84,7 +84,7 @@ class WriteTasks(Action): async def _update_requirements(self, doc): m = json.loads(doc.content) - packages = set(m.get("Required Python packages", set())) + packages = set(m.get("Required packages", set())) requirement_doc = await self.repo.get(filename=PACKAGE_REQUIREMENTS_FILENAME) if not requirement_doc: requirement_doc = Document(filename=PACKAGE_REQUIREMENTS_FILENAME, root_path=".", content="") diff --git a/metagpt/actions/project_management_an.py b/metagpt/actions/project_management_an.py index 0417c0ce4..f53062433 100644 --- a/metagpt/actions/project_management_an.py +++ b/metagpt/actions/project_management_an.py @@ -5,14 +5,14 @@ @Author : alexanderwu @File : project_management_an.py """ -from typing import List +from typing import List, Optional from metagpt.actions.action_node import ActionNode -REQUIRED_PYTHON_PACKAGES = ActionNode( - key="Required Python packages", - expected_type=List[str], - instruction="Provide required Python packages in requirements.txt format.", +REQUIRED_PACKAGES = ActionNode( + key="Required packages", + expected_type=Optional[List[str]], + instruction="Provide required third-party packages in requirements.txt format.", example=["flask==1.1.2", "bcrypt==3.2.0"], ) @@ -97,7 +97,7 @@ ANYTHING_UNCLEAR_PM = ActionNode( ) NODES = [ - REQUIRED_PYTHON_PACKAGES, + REQUIRED_PACKAGES, REQUIRED_OTHER_LANGUAGE_PACKAGES, LOGIC_ANALYSIS, TASK_LIST, @@ -107,7 +107,7 @@ NODES = [ ] REFINED_NODES = [ - REQUIRED_PYTHON_PACKAGES, + REQUIRED_PACKAGES, REQUIRED_OTHER_LANGUAGE_PACKAGES, REFINED_LOGIC_ANALYSIS, REFINED_TASK_LIST, diff --git a/metagpt/actions/write_code_an_draft.py b/metagpt/actions/write_code_an_draft.py index ce030b0e9..20ed201a3 100644 --- a/metagpt/actions/write_code_an_draft.py +++ b/metagpt/actions/write_code_an_draft.py @@ -139,7 +139,7 @@ Language: Please use the same language as the user requirement, but the title an end", "Anything UNCLEAR": "目前项目要求明确,没有不清楚的地方。"} ## Tasks -{"Required Python packages": ["无需Python包"], "Required Other language third-party packages": ["vue.js"], "Logic Analysis": [["index.html", "作为游戏的入口文件和主要的HTML结构"], ["styles.css", "包含所有的CSS样式,确保游戏界面美观"], ["main.js", "包含Main类,负责初始化游戏和绑定事件"], ["game.js", "包含Game类,负责游戏逻辑,如开始游戏、移动方块等"], ["storage.js", "包含Storage类,用于获取和设置玩家的最高分"]], "Task list": ["index.html", "styles.css", "storage.js", "game.js", "main.js"], "Full API spec": "", "Shared Knowledge": "\'game.js\' 包含游戏逻辑相关的函数,被 \'main.js\' 调用。", "Anything UNCLEAR": "目前项目要求明确,没有不清楚的地方。"} +{"Required packages": ["无需第三方包"], "Required Other language third-party packages": ["vue.js"], "Logic Analysis": [["index.html", "作为游戏的入口文件和主要的HTML结构"], ["styles.css", "包含所有的CSS样式,确保游戏界面美观"], ["main.js", "包含Main类,负责初始化游戏和绑定事件"], ["game.js", "包含Game类,负责游戏逻辑,如开始游戏、移动方块等"], ["storage.js", "包含Storage类,用于获取和设置玩家的最高分"]], "Task list": ["index.html", "styles.css", "storage.js", "game.js", "main.js"], "Full API spec": "", "Shared Knowledge": "\'game.js\' 包含游戏逻辑相关的函数,被 \'main.js\' 调用。", "Anything UNCLEAR": "目前项目要求明确,没有不清楚的地方。"} ## Code Files ----- index.html