mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
refactor(speech): type the bridge voice param as a mapping and wrap a long test line
This commit is contained in:
parent
b34064fe30
commit
f269b52a15
2 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue