update comment

This commit is contained in:
黄伟韬 2024-09-06 14:33:09 +08:00
parent a68f9efce5
commit 6e49c2475f
2 changed files with 4 additions and 3 deletions

View file

@ -73,7 +73,8 @@ class RoleZero(Role):
tool_recommender: Optional[ToolRecommender] = None
tool_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",

View file

@ -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 file
else:
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),