From 3bde9e1827a4e88d81a654ddace4172b2118c1d4 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Mon, 23 Mar 2026 09:50:27 -0700 Subject: [PATCH] fix(vertex_ai/files): handle IO[bytes] content in non-JSONL file upload path --- litellm/llms/vertex_ai/files/transformation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/litellm/llms/vertex_ai/files/transformation.py b/litellm/llms/vertex_ai/files/transformation.py index 070ec508283..69c5892780d 100644 --- a/litellm/llms/vertex_ai/files/transformation.py +++ b/litellm/llms/vertex_ai/files/transformation.py @@ -1,3 +1,4 @@ +import io import json import os import time @@ -292,6 +293,8 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig): return "\n".join(json.dumps(item) for item in vertex_jsonl_content) elif isinstance(extracted_file_data_content, bytes): return extracted_file_data_content + elif isinstance(extracted_file_data_content, io.IOBase): + return extracted_file_data_content # type: ignore[return-value] else: raise ValueError("Unsupported file content type")