🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
update comment
黄伟韬6e49c2475f36
diff --git a/metagpt/roles/di/role_zero.py b/metagpt/roles/di/role_zero.pyindex 386dbd43d..db8d2aa5f 100644--- a/metagpt/roles/di/role_zero.py+++ b/metagpt/roles/di/role_zero.py@@ -73,7 +73,8 @@ class RoleZero(Role):tool_recommender: Optional[ToolRecommender] = Nonetool_execution_map: Annotated[dict[str, Callable], Field(exclude=True)] = {}special_tool_commands: list[str] = ["Plan.finish_current_task", "end", "Bash.run"]- # List of exclusive tool commands+ # List of exclusive tool commands.+ # If multiple instances of these commands appear, only the first occurrence will be retained.exclusive_tool_commands: list[str] = ["Editor.edit_file_by_replace","Editor.insert_content_at_line",diff --git a/metagpt/tools/libs/editor.py b/metagpt/tools/libs/editor.pyindex d35fb124a..e358c2288 100644--- a/metagpt/tools/libs/editor.py+++ b/metagpt/tools/libs/editor.py@@ -58,7 +58,7 @@ Your changes have NOT been applied. Please fix your edit command and try again"""-SUCCESS_EDITE_INFO = """+SUCCESS_EDIT_INFO = """[File: {file_name} ({n_total_lines} lines total after edit)]{window_after_applied}[File updated (edited at line {line_number}). Please review the changes and make sure they are correct (correct indentation, no duplicate lines, etc). Edit the file again if necessary.]@@ -746,7 +746,7 @@ class Editor(BaseModel):self.current_line = max(1, len(lines)) # end of original fileelse:self.current_line = start or n_total_lines or 1- success_edit_info = SUCCESS_EDITE_INFO.format(+ success_edit_info = SUCCESS_EDIT_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),