refactor: update search tool parameters and documentation for clarity

- Changed the target parameter from "content" and "files" to "grep" and "find" to better represent their functionality.
- Revised descriptions in the tool definitions and execution code schema to enhance understanding of search modes and output formats.
- Ensured consistency in the handling of search operations across the codebase.
This commit is contained in:
teknium1
2026-02-20 02:46:30 -08:00
parent f9eb5edb96
commit c0d412a736
2 changed files with 16 additions and 12 deletions

View File

@@ -90,8 +90,8 @@ _TOOL_STUBS = {
),
"search_files": (
"search_files",
'pattern: str, target: str = "content", path: str = ".", file_glob: str = None, limit: int = 50',
'"""Search file contents (target="content") or find files (target="files"). Returns dict with "matches"."""',
'pattern: str, target: str = "grep", path: str = ".", file_glob: str = None, limit: int = 50',
'"""Search file contents (target="grep") or find files by name (target="find"). Returns dict with "matches"."""',
'{"pattern": pattern, "target": target, "path": path, "file_glob": file_glob, "limit": limit}',
),
"patch": (
@@ -553,8 +553,8 @@ EXECUTE_CODE_SCHEMA = {
" Lines are 1-indexed. Returns {\"content\": \"...\", \"total_lines\": N}\n"
" write_file(path: str, content: str) -> dict\n"
" Always overwrites the entire file.\n"
" search_files(pattern: str, target=\"content\", path=\".\", file_glob=None, limit=50) -> dict\n"
" target: \"content\" (grep) or \"files\" (find). Returns {\"matches\": [...]}\n"
" search_files(pattern: str, target=\"grep\", path=\".\", file_glob=None, limit=50) -> dict\n"
" target: \"grep\" (search inside files) or \"find\" (find files by name). Returns {\"matches\": [...]}\n"
" patch(path: str, old_string: str, new_string: str, replace_all: bool = False) -> dict\n"
" Replaces old_string with new_string in the file.\n"
" terminal(command: str, timeout=None, workdir=None) -> dict\n"