Show what read_file returns if a PDF falls back to the tool path.
(pdf_path: Path)
| 79 | |
| 80 | |
| 81 | def inspect_fallback_tool(pdf_path: Path) -> None: |
| 82 | """Show what read_file returns if a PDF falls back to the tool path.""" |
| 83 | from crewai.tools.agent_tools.read_file_tool import ReadFileTool |
| 84 | |
| 85 | tool = ReadFileTool() |
| 86 | tool.set_files({"document": PDFFile(source=str(pdf_path))}) |
| 87 | result = tool._run("document") |
| 88 | |
| 89 | print("\n== read_file Fallback ==") |
| 90 | print(f"Returned {len(result)} chars") |
| 91 | print(f"Contains Base64 marker: {'YES' if 'Base64:' in result else 'NO'}") |
| 92 | print("\nPreview:") |
| 93 | print(result[:1200]) |
| 94 | if len(result) > 1200: |
| 95 | print("...") |
| 96 | |
| 97 | |
| 98 | def run_crew_kickoff( |
no test coverage detected