From 475220ecc65236236b0c3c0550845d6f4adf4186 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Fri, 1 May 2026 17:46:20 +0530 Subject: [PATCH] Fix greptile review --- litellm/proxy/container_endpoints/handler_factory.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/litellm/proxy/container_endpoints/handler_factory.py b/litellm/proxy/container_endpoints/handler_factory.py index 33df72ceaeb..794051e90f8 100644 --- a/litellm/proxy/container_endpoints/handler_factory.py +++ b/litellm/proxy/container_endpoints/handler_factory.py @@ -228,6 +228,12 @@ async def _process_binary_request( elif ".pdf" in file_id_lower: content_type = "application/pdf" + if not isinstance(content, bytes): + raise TypeError( + "aretrieve_container_file_content expected bytes, got " + f"{type(content).__name__}" + ) + return Response( content=content, headers=dict(fastapi_response.headers),