litellm/tests/test_litellm_rust/ocr
zoveki 8842dffe43 feat(ocr)!: support outputContentFormat=markdown for Azure Document Intelligence (#48926)
* feat(ocr): support outputContentFormat=markdown for Azure Document Intelligence

* fix(ocr): map only span endpoints when slicing Azure Markdown pages

* fix(ocr): accept any casing of outputContentFormat and report code point offsets

Azure reads outputContentFormat case-insensitively, so Markdown and TEXT
now map to the same values instead of returning 400. When the proxy asks
Azure for code point offsets to split Markdown pages, the response now
carries stringIndexType so callers know the unit of table and key-value
spans. Tests use rstest and the enum derives VariantArray per the Rust
workspace rules.

* fix(ocr): ask Azure for code point offsets only on prebuilt-layout and keep line-joined pages when spans are malformed

* fix(ocr): trim Azure DI outputContentFormat, accept output_content_format, and drop invalid values under drop_params

* fix(ocr): fall back to output_content_format when outputContentFormat is empty

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
(cherry picked from commit b96c1f30a6)
2026-11-16 21:06:32 -08:00
..
__init__.py
conftest.py test(rust-bridge): select native routes per test without LITELLM_RUST (#46620) 2026-10-15 09:12:08 -07:00
data.py test(rust-bridge): pin Messages and Responses callback contracts on the native path (#46443) 2026-10-14 17:07:20 -07:00
test_callbacks.py test(rust-bridge): pin Messages and Responses callback contracts on the native path (#46443) 2026-10-14 17:07:20 -07:00
test_dispatch.py test(rust-bridge): select native routes per test without LITELLM_RUST (#46620) 2026-10-15 09:12:08 -07:00
test_failures.py feat(ocr)!: support outputContentFormat=markdown for Azure Document Intelligence (#48926) 2026-11-16 21:06:32 -08:00
test_guardrails.py test(rust-bridge): pin Messages and Responses callback contracts on the native path (#46443) 2026-10-14 17:07:20 -07:00
test_lifecycle.py refactor(rust-bridge): return an unstarted Execution from native entrypoints and drive it in Python (#46299) 2026-10-14 17:50:44 -07:00
test_passthrough.py refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00
test_requests.py feat(ocr)!: support outputContentFormat=markdown for Azure Document Intelligence (#48926) 2026-11-16 21:06:32 -08:00
test_settings.py test(rust-bridge): pin Messages and Responses callback contracts on the native path (#46443) 2026-10-14 17:07:20 -07:00