mistralai Python SDK: `files.upload(purpose="ocr")` fails its own type check

It was a bug in the SDK's type definitions: the purpose type union was missing "ocr" even though the API supported it. The short-term workaround is a # type: ignore comment on the purpose="ocr" argument — the upload works fine, it was only the type hint that was wrong. The real fix shipped in mistralai 1.5.2 (PR #206 updated the client types), confirmed by the maintainer. So update to 1.5.2 or newer and the type error goes away.

Source: https://github.com/mistralai/client-python/issues/196