From ea56e834c38616f0e1fb6a79b1ccf23421fd7ccc Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Mon, 22 Jun 2026 19:49:51 -0700 Subject: [PATCH] refactor(google_genai): type streaming iterator response as httpx.Response Drops 4 reportUnknown* basedpyright findings that the bytes-buffering rewrite would otherwise leak from the untyped response parameter. --- litellm/google_genai/streaming_iterator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/google_genai/streaming_iterator.py b/litellm/google_genai/streaming_iterator.py index f9116656e8e..4037aa9b8d9 100644 --- a/litellm/google_genai/streaming_iterator.py +++ b/litellm/google_genai/streaming_iterator.py @@ -2,6 +2,8 @@ import asyncio from datetime import datetime from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple +import httpx + from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj from litellm.proxy.pass_through_endpoints.success_handler import ( PassThroughEndpointLogging, @@ -92,7 +94,7 @@ class GoogleGenAIGenerateContentStreamingIterator( def __init__( self, - response, + response: httpx.Response, model: str, logging_obj: LiteLLMLoggingObj, generate_content_provider_config: BaseGoogleGenAIGenerateContentConfig, @@ -153,7 +155,7 @@ class AsyncGoogleGenAIGenerateContentStreamingIterator( def __init__( self, - response, + response: httpx.Response, model: str, logging_obj: LiteLLMLoggingObj, generate_content_provider_config: BaseGoogleGenAIGenerateContentConfig,