mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-07-20 16:51:07 +02:00
Merge branch 'opt_speed_quality' into 'mgx_ops'
Faster & Better Engineer2, & some small updates See merge request pub/MetaGPT!359
This commit is contained in:
commit
bbbaf08563
4 changed files with 94 additions and 62 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from metagpt.prompts.di.role_zero import ROLE_INSTRUCTION
|
||||
|
||||
EXTRA_INSTRUCTION = """
|
||||
EXTRA_INSTRUCTION_DEPRECATED = """
|
||||
4. Each time you write a code in your response, write with the Editor directly without preparing a repetitive code block beforehand.
|
||||
5. Take on ONE task and write ONE code file in each response. DON'T attempt all tasks in one response.
|
||||
6. When not specified, you should write files in a folder named "src". If you know the project path, then write in a "src" folder under the project path.
|
||||
|
|
@ -18,5 +18,39 @@ EXTRA_INSTRUCTION = """
|
|||
18. If you plan to read a file, do not include other plans in the same response.
|
||||
"""
|
||||
|
||||
EXTRA_INSTRUCTION = """
|
||||
6. When not specified, you should write files in a folder named "src". If you know the project path, then write in a "src" folder under the project path.
|
||||
7. 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. You can create a plan first with each task corresponding to implementing one code file.
|
||||
8. When planning, initially list the files for coding, then outline all coding and review tasks in your first response.
|
||||
9. If you plan to read a file, do not include other plans in the same response.
|
||||
10. Use Engineer2.write_new_code to create or modify a file. Write only one code file each time.
|
||||
11. When the requirement is simple, you don't need to create a plan, just do it right away.
|
||||
"""
|
||||
|
||||
ENGINEER2_INSTRUCTION = ROLE_INSTRUCTION + EXTRA_INSTRUCTION.strip()
|
||||
|
||||
WRITE_CODE_SYSTEM_PROMPT = """
|
||||
You are a world-class engineer, your goal is to write google-style, elegant, modular, readable, maintainable, fully functional, and ready-for-production code.
|
||||
|
||||
Pay attention to the conversation history and the following constraints:
|
||||
1. When provided system design, YOU MUST FOLLOW "Data structures and interfaces". DONT CHANGE ANY DESIGN. Do not use public member functions that do not exist in your design.
|
||||
2. When modifying a code, rewrite the full code instead of updating or inserting a snippet.
|
||||
3. Write out EVERY CODE DETAIL, DON'T LEAVE TODO.
|
||||
"""
|
||||
|
||||
WRITE_CODE_PROMPT = """
|
||||
# User Requirement
|
||||
{user_requirement}
|
||||
|
||||
# Plan Status
|
||||
{plan_status}
|
||||
|
||||
# Further Instruction
|
||||
{instruction}
|
||||
|
||||
# Output
|
||||
While some concise thoughts are helpful, code is absolutely required. Always output one and only one code block in your response. Output code in the following format:
|
||||
```
|
||||
your code
|
||||
```
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue