mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 05:09:51 +08:00
The reading chain only pulled embedded images out of Office files; the PDF branch produced text alone, so a slide deck uploaded as PDF reported media_count 0 and no [图片 N] markers at all. The chat-attachment path already had the missing half (extract_pdf_images + per-page markers), so the reader now reuses it: each page's figures are pinned to that page's locator and the marker lines are appended at the END of the page text, leaving every existing character offset — and therefore every saved annotation anchor — untouched. Budgets differ by path. Chat attachments inflate images into one request, so they keep the 12-image/12MB document cap; the reader stores bytes on disk and only ever sends the open page, so reading_image_budget() allows 120 images / 60MB per document while capping each page at 4 — the same ceiling the viewport injection applies per turn, which keeps one dense figure page from eating the document budget. extract_pdf_images/extract_docx_rich/extract_pptx_rich now accept an explicit ImageBudget, defaulting to the previous behaviour. Measured on the physics decks: day03_GaussLaw.pdf goes from 0 to 63 media rows across 23 of its 42 pages (66 candidates, 3 dropped by the per-page cap).