open-webui/backend/open_webui/retrieval
Classic298 c3394288bb
fix: repair Mistral OCR async upload (aiohttp.streams.FilePayload removed) (#25779)
_upload_file_async built its multipart body with
`aiohttp.streams.FilePayload(...)`, which no longer exists in aiohttp
(payload classes live in aiohttp.payload, and there is no FilePayload).
The reference sits inside a lazy closure, so import succeeds and only the
async Mistral OCR file-upload path blows up at runtime with
AttributeError on every call.

Mirror the working sync path: open the file in a context manager and let
MultipartWriter.append(file_obj, {...}) build a streaming
BufferedReaderPayload, with the POST issued inside the open() block so
the handle stays valid for the whole upload. Preserves the streaming /
memory-efficiency intent.

Found via the dependency-contract test suite (unit/deps/test_aiohttp.py),
which pins aiohttp.streams.FilePayload as absent.
2026-06-29 02:05:54 -05:00
..
loaders fix: repair Mistral OCR async upload (aiohttp.streams.FilePayload removed) (#25779) 2026-06-29 02:05:54 -05:00
models refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
vector refac 2026-06-29 02:03:58 -05:00
web refac 2026-06-29 01:52:07 -05:00
external.py refac 2026-06-23 23:13:32 +02:00
utils.py refac 2026-06-23 23:13:32 +02:00