Show whether the PDF is treated as a native multimodal input.
(pdf_path: Path, provider: str, api: str | None)
| 56 | |
| 57 | |
| 58 | def inspect_native_path(pdf_path: Path, provider: str, api: str | None) -> None: |
| 59 | """Show whether the PDF is treated as a native multimodal input.""" |
| 60 | pdf = PDFFile(source=str(pdf_path)) |
| 61 | supported_types = get_supported_content_types(provider, api=api) |
| 62 | blocks = format_multimodal_content( |
| 63 | {"document": pdf}, |
| 64 | provider=provider, |
| 65 | api=api, |
| 66 | text="Summarize this PDF.", |
| 67 | ) |
| 68 | |
| 69 | print("\n== Native File Formatting ==") |
| 70 | print(f"PDF: {pdf_path}") |
| 71 | print(f"Provider/API: {provider} / {api or 'default'}") |
| 72 | print(f"Supported content types: {supported_types}") |
| 73 | print(f"Content block count: {len(blocks)}") |
| 74 | for index, block in enumerate(blocks, start=1): |
| 75 | print(f" {index}. {_content_summary(block)}") |
| 76 | |
| 77 | has_pdf_block = any(block.get("type") == "input_file" for block in blocks) |
| 78 | print(f"PDF native input_file block: {'YES' if has_pdf_block else 'NO'}") |
| 79 | |
| 80 | |
| 81 | def inspect_fallback_tool(pdf_path: Path) -> None: |
no test coverage detected