refactor(speech): type the bridge voice param as a mapping and wrap a long test line

This commit is contained in:
mateo-berri 2026-08-29 15:26:05 -07:00
parent b34064fe30
commit f269b52a15
2 changed files with 4 additions and 2 deletions

View file

@ -45,7 +45,7 @@ class SpeechToCompletionBridgeTransformationHandler:
return response_format if isinstance(response_format, str) else None
def _chat_audio_param(
self, model: str, voice: str | dict | None, optional_params: Mapping[str, object]
self, model: str, voice: str | Mapping[str, object] | None, optional_params: Mapping[str, object]
) -> ChatAudioParam | None:
if not isinstance(voice, str):
return None

View file

@ -13,7 +13,9 @@ GEMINI_TTS_MODEL: Final = "gemini-3.1-flash-tts-preview"
def _bridge_request(response_format: str | None) -> dict:
optional_params: Final = {"temperature": 0.4} if response_format is None else {"temperature": 0.4, "response_format": response_format}
optional_params: Final = (
{"temperature": 0.4} if response_format is None else {"temperature": 0.4, "response_format": response_format}
)
return SpeechToCompletionBridgeTransformationHandler().transform_request(
model=GEMINI_TTS_MODEL,
input="Hello from LiteLLM",