small improvement

This commit is contained in:
garylin2099 2024-05-15 23:07:34 +08:00
parent 4d05bba39c
commit 6538092235
3 changed files with 5 additions and 3 deletions

View file

@ -238,7 +238,7 @@ Explanation: The requirement is to fix an issue in an existing repository. The p
"args": {
"task_id": "3",
"dependent_task_ids": ["2"],
"instruction": "Use Editor to search the relevant function(s), then diagnose and identify the source of the problem.",
"instruction": "Use Editor to search relevant function(s) or open relevant files, then diagnose and identify the source of the problem.",
"assignee": "David"
}
},

View file

@ -4,6 +4,7 @@ import subprocess
from pydantic import BaseModel
from metagpt.const import DEFAULT_WORKSPACE_ROOT
from metagpt.tools.tool_registry import register_tool
from metagpt.utils.report import EditorReporter
@ -20,6 +21,7 @@ class Editor:
"""A tool for reading, understanding, writing, and editing files"""
def __init__(self) -> None:
print(f"Editor initialized with root path at: {DEFAULT_WORKSPACE_ROOT}")
self.resource = EditorReporter()
def write(self, path: str, content: str):
@ -58,7 +60,7 @@ class Editor:
block_content: str
"""
if not os.path.exists(root_path):
print(f"Currently at {os.getcwd()}. Path {root_path} does not exist.")
print(f"Currently at {os.getcwd()} containing: {os.listdir()}. Path {root_path} does not exist.")
return None
not_found_msg = (
"symbol not found, you may try searching another one, or break down your search term to search a part of it"

View file

@ -69,7 +69,7 @@ async def git_create_pull(
issue: Optional[Issue] = None,
) -> PullRequest:
"""
Creates a pull request on a Git repository.
Creates a pull request on a Git repository. Use this tool in priority over Browser to create a pull request.
Args:
base (str): The base branch of the pull request.