teff.rag.pdf_tool¶
teff.rag.pdf_tool
¶
PDF extraction tool — turn a PDF into per-page text for RAG.
Classes:
| Name | Description |
|---|---|
PDFTool |
Extract text from a PDF file, one section per page. |
PDFTool
¶
Bases: Tool
Extract text from a PDF file, one section per page.
Text-based PDFs are read with pypdf (extra teff[rag-pdf]).
Scanned / image-only pages yield no text — feed those pages to
:class:~teff.rag.image_tool.ImageTool instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict. |
None
|
Methods:
| Name | Description |
|---|---|
run |
Return the PDF text as |
Source code in teff/rag/pdf_tool.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
run
¶
run(path, max_chars=None)
Return the PDF text as --- page N --- sections.
Source code in teff/rag/pdf_tool.py
28 29 30 31 32 33 34 35 36 37 38 39 40 | |