update: editor

This commit is contained in:
liushaojie 2024-08-30 18:20:26 +08:00 committed by seeker-jie
parent 6ebb9952b8
commit 8ca577f22e
6 changed files with 46 additions and 18 deletions

View file

@ -42,9 +42,8 @@ class LineNumberError(Exception):
@register_tool()
class Editor(BaseModel):
"""
A state-of-state tool for open/reading, understanding, and editing/writing files.
Args:
working_dir: The working directory to use for the editor.
A tool for reading, understanding, writing, and editing files.
Support local file including text-based files (txt, md, json, py, html, js, css, etc.), pdf, docx, excluding images, csv, excel, or online links
"""
model_config = ConfigDict(arbitrary_types_allowed=True)
@ -281,7 +280,7 @@ class Editor(BaseModel):
def set_workdir(self, path: str) -> None:
"""
Sets the working directory to the given path. eg: repo directory.
You need to set it up before operating the file.
You MUST to set it up before open the file.
Args:
path: str: The path to set as the working directory.