From c4c56c31bed4248bdb30376bd5a275fa4bb021a9 Mon Sep 17 00:00:00 2001 From: landerrosette <57791410+landerrosette@users.noreply.github.com> Date: Wed, 12 Aug 2026 03:06:59 +0000 Subject: [PATCH] fix: preserve file parts in Responses payload conversion --- backend/open_webui/routers/openai.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/open_webui/routers/openai.py b/backend/open_webui/routers/openai.py index e5c9f2e7e8..89088fb8ed 100644 --- a/backend/open_webui/routers/openai.py +++ b/backend/open_webui/routers/openai.py @@ -1094,6 +1094,15 @@ def convert_to_responses_payload(payload: dict) -> dict: url_data = part.get('image_url', {}) url = url_data.get('url', '') if isinstance(url_data, dict) else url_data content_parts.append({'type': 'input_image', 'image_url': url}) + elif part.get('type') == 'file': + file = part.get('file', {}) + if isinstance(file, dict): + content_parts.append( + { + 'type': 'input_file', + **{k: v for k, v in file.items() if k in ('file_data', 'file_id', 'filename')}, + } + ) else: content_parts = [{'type': text_type, 'text': str(content)}]