Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions metagpt/prompts/di/engineer2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import time

from metagpt.const import REACT_TEMPLATE_PATH, VUE_TEMPLATE_PATH
from metagpt.prompts.di.role_zero import ROLE_INSTRUCTION

Expand Down Expand Up @@ -34,7 +36,7 @@
11.1 Do not use Editor.insert_content_at_line or Editor.edit_file_by_replace more than once per command list.
12. If you choose Editor.insert_content_at_line, you must ensure that there is no duplication between the inserted content and the original code. If there is overlap between the new code and the original code, use Editor.edit_file_by_replace instead.
13. If you choose Editor.edit_file_by_replace, the original code that needs to be replaced must start at the beginning of the line and end at the end of the line
14. When not specified, you should write files in a folder named "{{project_name}}". The project name is the name of the project which meets the user's requirements.
14. When not specified, you should write files in a folder named "{{project_name}}_{timestamp}". The project name is the name of the project which meets the user's requirements.
15. When provided system design or project schedule, you MUST read them first before making a plan, then adhere to them in your implementation, especially in the programming language, package, or framework. You MUST implement all code files prescribed in the system design or project schedule.
16. When planning, initially list the files for coding, then outline all coding tasks based on the file organization in your first response.
17. If you plan to read a file, do not include other plans in the same response.
Expand All @@ -47,10 +49,10 @@
24. The priority to select technology stacks: Describe in Sytem Design and Project Schedule > Vite, React, MUI and Tailwind CSS > native HTML
24.1. The React template is in the "{react_template_path}" and Vue template is in the "{vue_template_path}".
25. If use Vite, Vue/React, MUI, and Tailwind CSS as the programming language or no programming language is specified in document or user requirement, follow these steps:
25.1. Create the project folder if no exists. Use cmd " mkdir -p {{project_name}} "
25.2. Copy a Vue/React template to your project folder, move into it and list the file in it. Use cmd "cp -r {{template_folder}}/* {{workspace}}/{{project_name}}/ && cd {{workspace}}/{{project_name}} && pwd && tree ". This must be a single response without other commands.
25.1. Create the project folder if no exists. Use cmd " mkdir -p {{project_name}}_{timestamp} "
25.2. Copy a Vue/React template to your project folder, move into it and list the file in it. Use cmd "cp -r {{template_folder}}/* {{workspace}}/{{project_name}}_{timestamp}/ && cd {{workspace}}/{{project_name}}_{timestamp} && pwd && tree ". This must be a single response without other commands.
25.3. User Editor.read to read the content of files in the src and read the index.html in the project root before making a plan.
25.4. List the files that you need to rewrite and create when making a plan. Indicate clearly what file to rewrite or create in each task. "index.html" and all files in the src folder always must be rewritten. Use Tailwind CSS for styling. Notice that you are in {{project_name}}.
25.4. List the files that you need to rewrite and create when making a plan. Indicate clearly what file to rewrite or create in each task. "index.html" and all files in the src folder always must be rewritten. Use Tailwind CSS for styling. Notice that you are in {{project_name}}_{timestamp}.
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.
Expand All @@ -59,6 +61,7 @@
""".format(
vue_template_path=VUE_TEMPLATE_PATH.resolve().absolute(),
react_template_path=REACT_TEMPLATE_PATH.resolve().absolute(),
timestamp=int(time.time()),
)
CURRENT_STATE = """
The current editor state is:
Expand Down
1 change: 0 additions & 1 deletion metagpt/utils/token_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
"openai/o1-preview": {"prompt": 0.015, "completion": 0.06},
"openai/o1-mini": {"prompt": 0.003, "completion": 0.012},
"anthropic/claude-3-opus": {"prompt": 0.015, "completion": 0.075},
"anthropic/claude-3.5-sonnet": {"prompt": 0.003, "completion": 0.015},
"anthropic/claude-3.7-sonnet": {"prompt": 0.003, "completion": 0.015},
"anthropic/claude-3.7-sonnet:beta": {"prompt": 0.003, "completion": 0.015},
"anthropic/claude-3.7-sonnet:thinking": {"prompt": 0.003, "completion": 0.015},
Expand Down
Loading