Skip to content

Conversation

@georgeh0
Copy link
Member

@georgeh0 georgeh0 commented Dec 4, 2025

No description provided.

@badmonster0
Copy link
Member

woohoo! cc @prrao87

@badmonster0
Copy link
Member

thanks a lot @georgeh0 for the example. excited for both cocoindex and dspy community!

@badmonster0 badmonster0 merged commit 902e5c9 into main Dec 4, 2025
6 checks passed
@georgeh0 georgeh0 deleted the g/dspy branch December 4, 2025 19:16

form_images = []
for page in pdf_doc:
# Render page to pixmap (image) at 2x resolution for better quality
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is super cool! I've found that parsing images of higher quality results in fewer typos in the resulting output, at the cost of more tokens. But super useful approach to allow it to upscale the image!

"cocoindex>=0.3.9",
"dspy-ai>=3.0.4",
"pydantic>=2.0.0",
"pymupdf>=1.24.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@georgeh0 what is the need for pymupdf here if the LLM is directly extracting from the image bytes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this what fitz is? Oops, now I get it.

@prrao87
Copy link
Contributor

prrao87 commented Dec 4, 2025

This example is super cool! Love the usage of PyMuPDF to convert the PDF to image bytes and upsize it for the LLM. Really good methodology 👌🏽

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.

4 participants