mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix(speech): stop vertex gemini tts from dropping response_format in cloud tts param mapping
This commit is contained in:
parent
b67b44bdaa
commit
35a375e26f
2 changed files with 24 additions and 0 deletions
|
|
@ -9409,6 +9409,10 @@ class ProviderConfigManager:
|
|||
|
||||
return RunwayMLTextToSpeechConfig()
|
||||
elif litellm.LlmProviders.VERTEX_AI == provider:
|
||||
if "gemini" in model:
|
||||
# Gemini TTS uses the speech_to_completion bridge, and Google Cloud TTS param
|
||||
# mapping would drop response_format before the bridge sees it (LIT-6501)
|
||||
return None
|
||||
from litellm.llms.vertex_ai.text_to_speech.transformation import (
|
||||
VertexAITextToSpeechConfig,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1416,6 +1416,26 @@ def test_get_provider_rerank_config():
|
|||
assert isinstance(config, HostedVLLMRerankConfig)
|
||||
|
||||
|
||||
def test_get_provider_text_to_speech_config_vertex_gemini_skips_cloud_tts():
|
||||
"""Regression for LIT-6501: mapping vertex Gemini TTS params through Google Cloud TTS
|
||||
dropped response_format before the speech_to_completion bridge could honor it."""
|
||||
from litellm.llms.vertex_ai.text_to_speech.transformation import VertexAITextToSpeechConfig
|
||||
from litellm.utils import LlmProviders
|
||||
|
||||
assert (
|
||||
ProviderConfigManager.get_provider_text_to_speech_config(
|
||||
model="gemini-2.5-flash-preview-tts", provider=LlmProviders.VERTEX_AI
|
||||
)
|
||||
is None
|
||||
)
|
||||
assert isinstance(
|
||||
ProviderConfigManager.get_provider_text_to_speech_config(
|
||||
model="en-US-Studio-O", provider=LlmProviders.VERTEX_AI
|
||||
),
|
||||
VertexAITextToSpeechConfig,
|
||||
)
|
||||
|
||||
|
||||
# Models that should be skipped during testing
|
||||
OLD_PROVIDERS = ["aleph_alpha", "palm"]
|
||||
SKIP_MODELS = [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue