Skip to content
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

Merged
merged 3 commits into from
May 24, 2024

Conversation

li-boxuan
Copy link
Member

This is a follow-up of #1941

@li-boxuan li-boxuan requested a review from xingyaoww May 24, 2024 04:54
@@ -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
Copy link
Member Author

@li-boxuan li-boxuan May 24, 2024

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.
Copy link
Member Author

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.

Copy link
Member Author

@li-boxuan li-boxuan May 24, 2024

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much cleaner

Copy link
Member

@xingyaoww xingyaoww left a 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.
Copy link
Member

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.
Copy link
Member

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!

@xingyaoww xingyaoww merged commit c59bcbb into OpenDevin:main May 24, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants