You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(api): add optional MarkItDown OCR support (#2145)
MarkItDown advertises image extensions, but without OCR config it can
fail screenshots or scanned images with low-level no-content errors.
Add server-level MarkItDown OCR config that is off by default and
independent from HINDSIGHT_API_LLM_*. When OCR is enabled, the OCR API
key, base URL, and model are required explicitly.
Wire those settings into MarkItDown's llm_client support with a built-in
OCR prompt. Image uploads now fail fast with actionable errors when OCR
is disabled or required settings are missing.
Docs and front-end copy explain that image OCR depends on server config
and requires an OpenAI-compatible OCR/vision endpoint.
Closes#927
DEFAULT_FILE_PARSER="markitdown"# Default parser fallback chain (comma-separated, e.g. "iris,markitdown")
849
854
DEFAULT_FILE_PARSER_ALLOWLIST=None# Allowlist of parsers clients may request (None = all registered parsers)
855
+
DEFAULT_FILE_PARSER_MARKITDOWN_OCR_ENABLED=False
856
+
DEFAULT_FILE_PARSER_MARKITDOWN_OCR_PROMPT="""You are a precise OCR transcription engine.
857
+
858
+
Transcribe only the visible text in the image. Do not describe the image, summarize it, translate it, infer missing content, or add commentary. Preserve the original language, wording, numbers, punctuation, capitalization, and reading order. Reconstruct headings, lists, key-value fields, stamps, and tables as clean Markdown when the layout is clear. If text is unreadable or uncertain, write [unclear] for that span. Return only the extracted Markdown."""
850
859
DEFAULT_FILE_CONVERSION_MAX_BATCH_SIZE_MB=100# Max total batch size in MB (all files combined)
851
860
DEFAULT_FILE_CONVERSION_MAX_BATCH_SIZE=10# Max files per batch upload
0 commit comments