microsoft / microsoft/markitdown
Better exception handling/warning in LLMVisionOCRService.extract_text
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 186k
- Forks
- 13.7k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 49
Description
LLMVisionOCRService.extract_text() catches all exceptions from client.chat.completions.create() and stores them in OCRResult.error. However, PdfConverterWithOCR never inspects OCRResult.error. It only checks whether ocr_result.text is non-empty.
Therefore configuration errors, incompatible clients, unavailable models, API failures, etc. appear to the user as if OCR simply produced no text, with no warning or exception.
This makes it particularly difficult to debug errors and bugs in using markitdown-ocr...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at LLMVisionOCRService.extract_text() and PdfConverterWithOCR, following how client.chat.completions.create() failures are stored in OCRResult.error and how the converter handles ocr_result.text. Make OCR failures visible as a warning or exception instead of silently reporting no extracted text, and verify the behavior for configuration, client, model, and API failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100