mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix(elevenlabs): ruff format and cast-ok placement for CI lint
This commit is contained in:
parent
d196796c37
commit
87bd639bc0
1 changed files with 8 additions and 4 deletions
|
|
@ -10947,7 +10947,13 @@ async def elevenlabs_tts_stream_input_endpoint(
|
|||
}.items()
|
||||
if v is not None
|
||||
}
|
||||
voice_settings: Final[VoiceSettings | None] = cast(VoiceSettings, raw_voice_settings) if raw_voice_settings else None # cast-ok: dict built from typed float query params; structural match is guaranteed
|
||||
_cast_voice_settings: Final[VoiceSettings] = (
|
||||
cast( # cast-ok: dict built from typed float query params; structural match is guaranteed
|
||||
VoiceSettings,
|
||||
raw_voice_settings,
|
||||
)
|
||||
)
|
||||
voice_settings: Final[VoiceSettings | None] = _cast_voice_settings if raw_voice_settings else None
|
||||
|
||||
# Run guardrails and rate-limit checks before opening the upstream connection.
|
||||
# This mirrors what the batch TTS endpoint does via proxy_logging_obj.pre_call_hook().
|
||||
|
|
@ -11004,9 +11010,7 @@ async def elevenlabs_tts_stream_input_endpoint(
|
|||
end_time: Final = datetime.now(tz=timezone.utc)
|
||||
|
||||
try:
|
||||
model_info: Final = litellm.get_model_info(
|
||||
model=litellm_model, custom_llm_provider="elevenlabs"
|
||||
)
|
||||
model_info: Final = litellm.get_model_info(model=litellm_model, custom_llm_provider="elevenlabs")
|
||||
cost_per_char: Final = model_info.get("input_cost_per_character") or 0.0
|
||||
except Exception: # noqa: BLE001 # litellm.get_model_info raises multiple undocumented error types
|
||||
cost_per_char = 0.0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue