From 3ee4bf94a8edf5315cde5a895e2aecee261a00b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BC=9F=E9=9F=AC?= Date: Wed, 18 Sep 2024 09:54:16 +0800 Subject: [PATCH] fix typo --- metagpt/strategy/experience_retriever.py | 1 - metagpt/tools/libs/editor.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/metagpt/strategy/experience_retriever.py b/metagpt/strategy/experience_retriever.py index 266461f25..7cefe863c 100644 --- a/metagpt/strategy/experience_retriever.py +++ b/metagpt/strategy/experience_retriever.py @@ -992,7 +992,6 @@ the previous file look like: 032| self.location = (0,0) I only need to add a few lines to the file, so I will use Editor.insert_content_at_line. The new code will not cover the original code. Note that the Editor command must be executed in a single response, so this step will only involve using the Editor command. - ```json [ { diff --git a/metagpt/tools/libs/editor.py b/metagpt/tools/libs/editor.py index 75f6f2760..fd4784f65 100644 --- a/metagpt/tools/libs/editor.py +++ b/metagpt/tools/libs/editor.py @@ -871,7 +871,7 @@ class Editor(BaseModel): return ret_str def insert_content_at_line(self, file_name: str, line_number: int, insert_content: str) -> str: - """Insert a complete block of code before the given line number in a file That is, the new content will start at the beginning of the specified line, and the existing content of that line will be moved down. + """Insert a complete block of code before the given line number in a file. That is, the new content will start at the beginning of the specified line, and the existing content of that line will be moved down. This operation will NOT modify the content of the lines before or after the given line number. This function can not insert content the end of the file. Please use append_file instead, For example, if the file has the following content: