update engineer2 cmd prompt

This commit is contained in:
黄伟韬 2024-09-02 19:33:59 +08:00
parent 10b55155de
commit 68c10d05b0
2 changed files with 7 additions and 6 deletions

View file

@ -1,4 +1,4 @@
from metagpt.prompts.di.role_zero import ROLE_INSTRUCTION
from metagpt.prompts.di.role_zero import CMD_PROMPT, ROLE_INSTRUCTION
EXTRA_INSTRUCTION = """
You are an autonomous programmer
@ -76,6 +76,10 @@ Note:
21. If the code exists, use the Editor tool's open and edit commands to modify it. Since it is not a new code, do not use write_new_code.
22. Aways user absolute path as parameter. if no specific root path given, use "workspace/'project_name'" as default work space.
"""
ENGINEER2_CMD_PROMPT = (
CMD_PROMPT
+ "\nWhen using the Editor tool, the command list must contain a single command. Because the command is mutually exclusive."
)
CURRENT_EDITOR_STATE = """
The current editor state is:

View file

@ -12,11 +12,11 @@ from metagpt.logs import logger
from metagpt.prompts.di.engineer2 import (
CURRENT_EDITOR_STATE,
CURRENT_TERMINAL_STATE,
ENGINEER2_CMD_PROMPT,
ENGINEER2_INSTRUCTION,
WRITE_CODE_PROMPT,
WRITE_CODE_SYSTEM_PROMPT,
)
from metagpt.prompts.di.role_zero import CMD_PROMPT
from metagpt.roles.di.role_zero import RoleZero
from metagpt.schema import Message, UserMessage
from metagpt.strategy.experience_retriever import ENGINEER_EXAMPLE
@ -33,10 +33,7 @@ class Engineer2(RoleZero):
profile: str = "Engineer"
goal: str = "Take on game, app, and web development."
instruction: str = ENGINEER2_INSTRUCTION
cmd_prompt: str = (
CMD_PROMPT
+ "\nWhen using the Editor tool, the command list must contain a single command. Because the command is mutually exclusive."
)
cmd_prompt: str = ENGINEER2_CMD_PROMPT
terminal: Terminal = Field(default_factory=Terminal, exclude=True)
tools: list[str] = [