Skip to content

feat(read_attachment): convert PDF/Office attachments to Markdown via anydoc - #101

Open
fepfitra wants to merge 2 commits into
anvie:mainfrom
fepfitra:feat/anydoc-attachments
Open

feat(read_attachment): convert PDF/Office attachments to Markdown via anydoc#101
fepfitra wants to merge 2 commits into
anvie:mainfrom
fepfitra:feat/anydoc-attachments

Conversation

@fepfitra

@fepfitra fepfitra commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Replaces pypdf-only PDF extraction with optional firecrawl-anydoc converter (Rust, MIT). One code path covers PDF + docx/doc + xlsx/xls + pptx/ppt + ODF + RTF + EPUB.

  • _read_pdf_text_read_anydoc_text: lazy import anydoc, to_markdown_bytes, 100KB cap, same line-pagination
  • _ANYDOC_EXTS: pdf, docx/doc, xlsx/xls, pptx/ppt, odt/ods/odp, rtf, epub
  • Fallback: metadata block when anydoc absent or conversion fails (no breakage without dep)
  • requirements.txt: firecrawl-anydoc>=0.1.6
  • tools/read_attachment.json: description updated

Verified: docx/xlsx/real-PDF → markdown, pagination, 100KB cap, no-anydoc fallback. pytest: 43 passed.

… anydoc

Replace pypdf-only PDF extraction with optional firecrawl-anydoc converter:
covers PDF, docx/doc, xlsx/xls, pptx/ppt, ODF, RTF, EPUB in one code path.
Falls back to metadata block when anydoc unavailable or conversion fails.
@fepfitra
fepfitra force-pushed the feat/anydoc-attachments branch from fa34987 to b1c7d84 Compare August 7, 2026 08:33
routes/sessions.py imported _read_pdf_text/_is_pdf (attachment preview);
update to _read_anydoc_text/_is_anydoc. Update PDF tests for anydoc
fallback semantics (unavailable + conversion-failure paths).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant