From ca5fd1ecec859f8717de36800b9fff68fffa8987 Mon Sep 17 00:00:00 2001 From: Chesars Date: Sun, 22 Feb 2026 09:43:08 -0300 Subject: [PATCH] Revert "fix(vertex): use module-level import for ModelResponseStream instead of type: ignore" This reverts commit 7e4f07c45dcfbdc36df56cae4ab9109f79af1bf5. --- .../vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py index 28e6919065..377801ea59 100644 --- a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py +++ b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py @@ -80,7 +80,6 @@ from litellm.types.utils import ( ChatCompletionTokenLogprob, ChoiceLogprobs, CompletionTokensDetailsWrapper, - ModelResponseStream, PromptTokensDetailsWrapper, TopLogprob, Usage, @@ -1932,7 +1931,7 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig): @staticmethod def _process_candidates( # noqa: PLR0915 _candidates: List[Candidates], - model_response: Union[ModelResponse, ModelResponseStream], + model_response: Union[ModelResponse, "ModelResponseStream"], standard_optional_params: dict, cumulative_tool_call_index: int = 0, ) -> Tuple[List[dict], List[dict], List, List, int]: @@ -2094,7 +2093,7 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig): chat_completion_logprobs=chat_completion_logprobs, image_response=image_response, ) - model_response.choices.append(choice) + model_response.choices.append(choice) # type: ignore[arg-type] elif isinstance(model_response, ModelResponse): choice = litellm.Choices( finish_reason=VertexGeminiConfig._check_finish_reason( @@ -2105,7 +2104,7 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig): logprobs=chat_completion_logprobs, enhancements=None, ) - model_response.choices.append(choice) + model_response.choices.append(choice) # type: ignore[arg-type] return ( grounding_metadata,