crewAI-tools icon indicating copy to clipboard operation
crewAI-tools copied to clipboard

Calling Directory Tool and File Tool together fails due to errant ", needs extra output validation (or input validation)

Open jcoombes opened this issue 9 months ago • 0 comments

guidance_dir = (ROOT / "." / "data" / "guidance").as_posix()

docs_tool = DirectoryReadTool(directory=guidance_dir) file_tool = FileReadTool()

By default these tools don't work together and give Error 2 File not found.

I fixed this by creating a custom variant of filetool which calls file_path = file_path.strip().strip('"').strip("'")

before reading the file.

jcoombes avatar May 19 '24 19:05 jcoombes