MCPcopy Index your code
hub / github.com/FSoft-AI4Code/HyperAgent / _run

Method _run

src/hyperagent/tools/nav_tools.py:549–564  ·  view source on GitHub ↗

Finds the specified file inside the repository. Args: file_name (str): The name of the file to find. Returns: str: The path to the file.

(self, file_name: str)

Source from the content-addressed store, hash-verified

547 self.path = path
548
549 def _run(self, file_name: str):
550 """
551 Finds the specified file inside the repository.
552
553 Args:
554 file_name (str): The name of the file to find.
555
556 Returns:
557 str: The path to the file.
558
559 """
560 file_paths = find_all_file_paths(self.path, file_name)
561 file_paths = [file_path.replace(self.path, "") for file_path in file_paths]
562 if len(file_paths) == 0:
563 return "The file is not found, please check the file name again"
564 return "The file is found at: " + "\n".join(file_paths)
565
566if __name__ == "__main__":
567 # open_file = OpenFileTool(path='/datadrive5/huypn16/autogen_repo/repos/repo__astropy__astropy__commit__a5917978be39d13cd90b517e1de4e7a539ffaa48', language="python")

Callers

nothing calls this directly

Calls 2

find_all_file_pathsFunction · 0.90
replaceMethod · 0.80

Tested by

no test coverage detected