feat: Add PDF reading support to Matrix AI bot (MAT-10)

- Register RoomMessageFile callback, filter for application/pdf
- Extract text from PDFs using pymupdf (fitz)
- Send extracted text as context to LLM for summarization/Q&A
- Truncate at 50k chars to avoid token limits
- Add pymupdf to requirements.txt

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-02-18 22:09:24 +02:00
parent 9b509e899f
commit 5c5f442a74
2 changed files with 92 additions and 0 deletions

View File

@@ -8,3 +8,4 @@ matrix-nio[e2e]>=0.25,<1.0
canonicaljson>=2.0,<3.0
httpx>=0.27,<1.0
openai>=2.0,<3.0
pymupdf>=1.24,<2.0