Skip to content

Add OCR support - #32

Draft
KMikeeU wants to merge 3 commits into
tghamm:mainfrom
KMikeeU:main
Draft

KMikeeU wants to merge 3 commits into
tghamm:mainfrom
KMikeeU:main

Conversation

@KMikeeU

@KMikeeU KMikeeU commented Sep 30, 2025

Copy link
Copy Markdown

Fixes #28

Missing tests, but please let me know what you think!

@tghamm

tghamm commented Sep 30, 2025

Copy link
Copy Markdown
Owner

Hey there. Very cool! Would you be willing to add at least one test just to help me better understand flow of things?

@KMikeeU

KMikeeU commented Oct 9, 2025

Copy link
Copy Markdown
Author

Added one test for uploading images and one for pdf documents.

The Document DTO currently expects the Type field to either be the string document_url or image_url. This is honestly a bit nonsensical, it would probably make more sense to use hierarchical types here (e.g. an abstract Document class that is implemented by an ImageDocument or DocumentDocument(? PdfDocument?)). Not sure what fits the project best.

@tghamm

tghamm commented Oct 13, 2025

Copy link
Copy Markdown
Owner

Hi @KMikeeU, so I think you're on the right track with an Abtract Document class, then using a custom converter to toggle between the document_url or image_url. If you look at my repo tghamm/Anthropic.SDK, I make pretty heavy use of this pattern there, and it seems to serve the sdk pretty well. Would you be willing to give that a go?

Thanks so much for contributing to the library!

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.

Mistral OCR model useage

2 participants