-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor docstring & prompt fixes for AgentSkills #2028
Conversation
@@ -58,7 +58,7 @@ def _lint_file(file_path: str) -> Optional[str]: | |||
ret = 'ERRORS:\n' | |||
ret += result.stdout.decode().strip() | |||
return ret.rstrip('\n') | |||
# Linting skipped. Either the file is not a Python file or auto-linting is disabled. | |||
# Not a python file, skip linting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reason for this change: we already checked auto-linting before entering this function
@@ -50,8 +50,8 @@ edit_file(start: int, end: int, content: str) -> None: | |||
Edit a file. | |||
It replaces lines `start` through `end` (inclusive) with the given text `content` in the open file. Remember, the file must be open before editing. | |||
Args: | |||
start: int: The start line number. Must be greater or equal to 1. | |||
end: int: The end line number. Must be greater or equal to 1 AND greater than start AND less than or equal to the number of lines in the file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
greater than start
Reason for this fix: this is wrong. end
could be equal to start
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I am not sure if LLM would have trouble understanding the precedences of "AND" and "or" here. LLM seems to be doing well but I am hoping a more formal statement makes it more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -50,8 +50,8 @@ edit_file(start: int, end: int, content: str) -> None: | |||
Edit a file. | |||
It replaces lines `start` through `end` (inclusive) with the given text `content` in the open file. Remember, the file must be open before editing. | |||
Args: | |||
start: int: The start line number. Must be greater or equal to 1. | |||
end: int: The end line number. Must be greater or equal to 1 AND greater than start AND less than or equal to the number of lines in the file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much cleaner
@@ -12,7 +12,7 @@ | |||
- search_dir(search_term, dir_path='./'): Searches for a term in all files in the specified directory. | |||
- search_file(search_term, file_path=None): Searches for a term in the specified file or the currently open file. | |||
- find_file(file_name, dir_path='./'): Finds all files with the given name in the specified directory. | |||
- edit_file(path, start, end, content): Replaces lines in a file with the given content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting the typo!
This is a follow-up of #1941