Skip to content

Commit 331d90b

Browse files
authored
fix: search_files_by_name_tool error (#885)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # Please check the following before marking your PR as ready for review - [ ] I have added tests for my changes - [ ] I have updated the documentation or added new documentation as needed
1 parent 4211312 commit 331d90b

File tree

1 file changed

+8
-10
lines changed
  • src/codegen/extensions/langchain

1 file changed

+8
-10
lines changed

src/codegen/extensions/langchain/tools.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,27 +1090,25 @@ def _run(
10901090
class SearchFilesByNameInput(BaseModel):
10911091
"""Input for searching files by name pattern."""
10921092

1093-
pattern: str = Field(..., description="Glob pattern to search for (e.g. '*.py', 'test_*.py')")
1093+
pattern: str = Field(..., description="`fd`-compatible glob pattern to search for (e.g. '*.py', 'test_*.py')")
10941094

10951095

10961096
class SearchFilesByNameTool(BaseTool):
10971097
"""Tool for searching files by filename across a codebase."""
10981098

10991099
name: ClassVar[str] = "search_files_by_name"
11001100
description: ClassVar[str] = """
1101-
Search for files and directories by glob pattern across the active codebase. This is useful when you need to:
1102-
- Find specific file types (e.g., '*.py', '*.tsx')
1103-
- Locate configuration files (e.g., 'package.json', 'requirements.txt')
1104-
- Find files with specific names (e.g., 'README.md', 'Dockerfile')
1105-
1106-
Uses fd under the hood
1107-
"""
1101+
Search for files and directories by glob pattern across the active codebase. This is useful when you need to:
1102+
- Find specific file types (e.g., '*.py', '*.tsx')
1103+
- Locate configuration files (e.g., 'package.json', 'requirements.txt')
1104+
- Find files with specific names (e.g., 'README.md', 'Dockerfile')
1105+
"""
11081106
args_schema: ClassVar[type[BaseModel]] = SearchFilesByNameInput
11091107
codebase: Codebase = Field(exclude=True)
11101108

11111109
def __init__(self, codebase: Codebase):
11121110
super().__init__(codebase=codebase)
11131111

1114-
def _run(self, pattern: str, full_path: bool = False) -> str:
1112+
def _run(self, pattern: str) -> str:
11151113
"""Execute the glob pattern search using fd."""
1116-
return search_files_by_name(self.codebase, pattern, full_path).render()
1114+
return search_files_by_name(self.codebase, pattern).render()

0 commit comments

Comments
 (0)