litellm/litellm-rust/crates/python-bridge
mateo-berri 48a0d4ca66 fix(rust): read an OCR document that defines only __getitem__ by item again
The previous commit checked `in` before it read `file` or `mime_type`. For
an object that defines only `__getitem__`, Python answers `in` by indexing
it with 0, 1, 2 and so on, so a strict lookup raised KeyError: 0 and a
lookup that returns None for unknown keys never stopped

The `in` check now runs only for a Mapping, whose `in` reads its keys. Any
other document is read by item, and a KeyError means the caller left the
key out, as on the base

On lts/1.108.x the path sits under litellm-rust/, and the test hunk keeps
the line's `#[rstest::rstest]` attribute and its own validation test

(cherry picked from commit 156280896e)
2026-11-14 05:21:01 -08:00
..
benches refactor(rust): add types and core-utils crates, unify the provider error 2026-09-17 22:01:14 -07:00
src fix(rust): read an OCR document that defines only __getitem__ by item again 2026-11-14 05:21:01 -08:00
tests refactor(rust): add types and core-utils crates, unify the provider error 2026-09-17 22:01:14 -07:00
AGENTS.md refactor(rust-bridge): return an unstarted Execution from native entrypoints and drive it in Python (#46299) 2026-10-14 17:50:44 -07:00
build.rs feat: package Rust OCR bridge in LiteLLM wheel (#31267) 2026-06-25 12:32:55 -07:00
Cargo.toml refactor(rust): give Messages configs typed litellm params (#45611) 2026-10-09 16:29:45 -07:00
preflight_contract.json refactor(rust): move credential inheritance and the SDK limits out of the legacy callback crate into a driver preflight (#43259) 2026-09-26 01:09:36 +00:00