mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
update engineer prompt
This commit is contained in:
parent
7d859a10fb
commit
5aab97554c
3 changed files with 9 additions and 35 deletions
|
|
@ -6,7 +6,7 @@ You are an autonomous programmer
|
|||
The special interface consists of a file editor that shows you 100 lines of a file at a time.
|
||||
|
||||
You can use terminal commands (e.g., cat, ls, cd) by calling Terminal.run_command.
|
||||
Do Not run the code.
|
||||
|
||||
|
||||
You should carefully observe the behavior and results of the previous action, and avoid triggering repeated errors.
|
||||
|
||||
|
|
@ -75,10 +75,13 @@ Note:
|
|||
18. Use Engineer2.write_new_code to create or modify a file. Write only one code file each time. If you only need to code one file, provide all the necessary information in one response.
|
||||
19. When the requirement is simple, you don't need to create a plan, just do it right away.
|
||||
20. 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.
|
||||
21. Forbidden to run code in the terminal.
|
||||
|
||||
22. When using the editor, pay attention to the editor's current directory. When you use editor tools, the paths must be either absolute or relative to the editor's current directory.
|
||||
"""
|
||||
|
||||
"""
|
||||
21. Forbidden to run code in the terminal.
|
||||
Do Not run the code.
|
||||
"""
|
||||
CURRENT_STATE = """
|
||||
The current editor state is:
|
||||
(Editor current directory: {editor_current_directory})
|
||||
|
|
|
|||
|
|
@ -1007,24 +1007,8 @@ Since Editor.insert_content_at_line can only be used once per response, this tim
|
|||
In the next turn, I will try to add another code snippet
|
||||
|
||||
## example 11
|
||||
```
|
||||
#### Save the changes and commit them to the remote repository.
|
||||
|
||||
##### Push the changes from the local repository to the remote repository.
|
||||
Thought: All changes have been saved, let's push the code to the remote repository.
|
||||
```json
|
||||
[
|
||||
{
|
||||
"command_name": "Terminal.run_command",
|
||||
"args": {
|
||||
"cmd": "git push origin test-fix"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
##### Create a pull request (Optional): Merge the changes from the new branch into the master branch.
|
||||
Create a pull request (Optional): Merge the changes from the new branch into the master branch.
|
||||
Thought: Now that the changes have been pushed to the remote repository, due to the user's requirement, let's create a pull request to merge the changes into the master branch.
|
||||
```json
|
||||
[
|
||||
|
|
@ -1044,19 +1028,6 @@ Thought: Now that the changes have been pushed to the remote repository, due to
|
|||
```
|
||||
"""
|
||||
|
||||
"""
|
||||
## example 11
|
||||
I have finished all the tasks, so I will use Plan.finish_current_task and then follow the command ‘end’ to stop.
|
||||
```json
|
||||
[
|
||||
{
|
||||
"command_name": "end",
|
||||
"args": {
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
"""
|
||||
WEB_SCRAPING_EXAMPLE = """
|
||||
## action 1
|
||||
User Requirement: Scrap and list the restaurant names of first page by searching for the keyword `beef` on the website https://www.yelp.com/.
|
||||
|
|
|
|||
|
|
@ -747,13 +747,13 @@ class Editor(BaseModel):
|
|||
self.current_line = max(1, len(lines)) # end of original file
|
||||
else:
|
||||
self.current_line = start or n_total_lines or 1
|
||||
cuccess_edit_info = SUCCESS_EDITE_INFO.format(
|
||||
success_edit_info = SUCCESS_EDITE_INFO.format(
|
||||
file_name=file_name.resolve(),
|
||||
n_total_lines=n_total_lines,
|
||||
window_after_applied=self._print_window(file_name, self.current_line, self.window),
|
||||
line_number=self.current_line,
|
||||
).strip()
|
||||
return cuccess_edit_info
|
||||
return success_edit_info
|
||||
|
||||
def edit_file_by_replace(self, file_name: str, to_replace: str, new_content: str) -> str:
|
||||
"""Edit a file. This will search for `to_replace` in the given file and replace it with `new_content`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue