From 70586a3c8671a6b09eff420ed137f0f3a8371bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Wed, 8 May 2024 19:06:22 +0800 Subject: [PATCH] fixbug: js comment error --- metagpt/actions/write_code.py | 5 +++++ metagpt/actions/write_code_plan_and_change_an.py | 5 +++++ metagpt/actions/write_code_review.py | 9 +++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/metagpt/actions/write_code.py b/metagpt/actions/write_code.py index 6cfde2385..5a3b238fa 100644 --- a/metagpt/actions/write_code.py +++ b/metagpt/actions/write_code.py @@ -66,6 +66,11 @@ ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenc ## {filename} ... ``` +## Code: {filename} +```javascript +// {filename} +... +``` # Instruction: Based on the context, follow "Format example", write code. diff --git a/metagpt/actions/write_code_plan_and_change_an.py b/metagpt/actions/write_code_plan_and_change_an.py index a90946981..a3c0e50a4 100644 --- a/metagpt/actions/write_code_plan_and_change_an.py +++ b/metagpt/actions/write_code_plan_and_change_an.py @@ -184,6 +184,11 @@ Role: You are a professional engineer; The main goal is to complete incremental ## {filename} ... ``` +## Code: {filename} +```javascript +// {filename} +... +``` # Instruction: Based on the context, follow "Format example", write or rewrite code. ## Write/Rewrite Code: Only write one file {filename}, write or rewrite complete code using triple quotes based on the following attentions and context. diff --git a/metagpt/actions/write_code_review.py b/metagpt/actions/write_code_review.py index ed868c867..f0faea701 100644 --- a/metagpt/actions/write_code_review.py +++ b/metagpt/actions/write_code_review.py @@ -110,11 +110,16 @@ LGTM REWRITE_CODE_TEMPLATE = """ # Instruction: rewrite code based on the Code Review and Actions -## Rewrite Code: CodeBlock. If it still has some bugs, rewrite {filename} with triple quotes. Do your utmost to optimize THIS SINGLE FILE. Return all completed codes and prohibit the return of unfinished codes. -```Code +## Rewrite Code: CodeBlock. If it still has some bugs, rewrite {filename} using a Markdown code block, with the filename docstring preceding the code block. Do your utmost to optimize THIS SINGLE FILE. Return all completed codes and prohibit the return of unfinished codes. +```python ## {filename} ... ``` +or +```javascript +// {filename} +... +``` """