File size: 683 Bytes
b2b6341 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from pathlib import Path
from backend.ingestion.pdf_loader import ingest_pdf
# Put any small PDF file in your project folder
# and change this path to point to it
pdf_path = Path("test.pdf") # ← place any PDF here
if not pdf_path.exists():
print("[ERROR] Please place a PDF file named 'test.pdf' in the project root")
else:
result = ingest_pdf(pdf_path, "test.pdf")
print("\n[SUCCESS] PDF ingestion result:")
print(f" source_id : {result['source_id']}")
print(f" chunk_count: {result['chunk_count']}")
print(f" title : {result['title']}")
|