From 971e9c7dd8ab3674f8af74309a07deee9c33940a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BC=9F=E9=9F=AC?= Date: Mon, 21 Oct 2024 20:02:42 +0800 Subject: [PATCH] resolve the template path --- metagpt/prompts/di/architect.py | 4 ++-- metagpt/prompts/di/engineer2.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/metagpt/prompts/di/architect.py b/metagpt/prompts/di/architect.py index 112f040c5..6d114abaa 100644 --- a/metagpt/prompts/di/architect.py +++ b/metagpt/prompts/di/architect.py @@ -76,8 +76,8 @@ Anything UNCLEAR: Mention unclear project aspects, then try to clarify it. 6. If not memtioned, always use Editor.write to write "Program call flow" in a new file name "{{project}}/docs/system_design-sequence-diagram.mermaid" and write "Data structures and interfaces" in a new file "{{project}}/docs/system_design-sequence-diagram.mermaid-class-diagram". Mermaid code only. Do not add "```mermaid". """.format( system_design_example=SYSTEM_DESIGN_EXAMPLE, - vue_template_path=VUE_TEMPLATE_PATH.absolute(), - react_template_path=REACT_TEMPLATE_PATH.absolute(), + vue_template_path=VUE_TEMPLATE_PATH.resolve().absolute(), + react_template_path=REACT_TEMPLATE_PATH.resolve().absolute(), ) ARCHITECT_EXAMPLE = """ diff --git a/metagpt/prompts/di/engineer2.py b/metagpt/prompts/di/engineer2.py index 38b8ecc3c..25cd595cd 100644 --- a/metagpt/prompts/di/engineer2.py +++ b/metagpt/prompts/di/engineer2.py @@ -54,9 +54,10 @@ Note: 25.5. After finish the project. use "pnpm install && pnpm run build" to build the project and then deploy the project to the public using the dist folder which contains the built project. 26. Engineer2.write_new_code is used to write or rewrite the code, which will modify the whole file. Editor.edit_file_by_replace is used to edit a small part of the file. 27. Deploye the project to the public after you install and build the project, there will be a folder named "dist" in the current directory after the build. +28. Use Engineer2.write_new_code to rewrite the whole file when you fail to use Editor.edit_file_by_replace more than three times. """.format( - vue_template_path=VUE_TEMPLATE_PATH.absolute(), - react_template_path=REACT_TEMPLATE_PATH.absolute(), + vue_template_path=VUE_TEMPLATE_PATH.resolve().absolute(), + react_template_path=REACT_TEMPLATE_PATH.resolve().absolute(), ) CURRENT_STATE = """ The current editor state is: