From b01d7ef18d6f1fabd2be0aea8e1b65ab990fd41b Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Tue, 10 Nov 2026 16:38:53 -0800 Subject: [PATCH] test(vertex): type the transcription test's access token override (cherry picked from commit 63e6b48d7a003296f7c2cd9a5b43aa728a640707) --- .../test_vertex_ai_gemini_transcribe_transformation.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/unit/llms/vertex_ai/audio_transcription/test_vertex_ai_gemini_transcribe_transformation.py b/tests/unit/llms/vertex_ai/audio_transcription/test_vertex_ai_gemini_transcribe_transformation.py index c492ae70cc0..65b3b43232c 100644 --- a/tests/unit/llms/vertex_ai/audio_transcription/test_vertex_ai_gemini_transcribe_transformation.py +++ b/tests/unit/llms/vertex_ai/audio_transcription/test_vertex_ai_gemini_transcribe_transformation.py @@ -2,7 +2,7 @@ import base64 import json import os from types import MappingProxyType -from typing import Final, cast +from typing import Final, Literal, cast import httpx import pytest @@ -16,6 +16,7 @@ from litellm.llms.vertex_ai.audio_transcription.transformation import ( VertexAIAudioTranscriptionConfig, ) from litellm.llms.vertex_ai.common_utils import VertexAIError +from litellm.types.llms.vertex_ai import VERTEX_CREDENTIALS_TYPES from litellm.types.utils import LlmProviders, TranscriptionUsageTokensObject from litellm.utils import ProviderConfigManager, get_optional_params_transcription @@ -363,7 +364,12 @@ def test_gemini_transcription_carries_identity_labels_only_while_the_setting_is_ class _TokenStubbedConfig(VertexGeminiAudioTranscriptionConfig): - def _ensure_access_token(self, credentials, project_id, custom_llm_provider): + def _ensure_access_token( + self, + credentials: VERTEX_CREDENTIALS_TYPES | None, + project_id: str | None, + custom_llm_provider: Literal["vertex_ai", "vertex_ai_beta", "gemini"], + ) -> tuple[str, str]: return "fake-token", "resolved-project"