fix: correct transcription mode string and add missing non-chat modes

- Replace 'transcription' with 'audio_transcription' (the actual mode string
  used by whisper-1 and all other transcription models in model_prices_and_context_window.json)
- Add image_edit, ocr, search, moderation to _NON_CHAT_MODES — all reject max_tokens
- Update parametrized test to use real mode strings from the model registry
This commit is contained in:
Udit 2026-04-27 22:46:58 +05:30
parent b5d047fbaf
commit a78fa80824
No known key found for this signature in database
GPG key ID: FCF5DBA5D134B6C8
2 changed files with 10 additions and 2 deletions

View file

@ -368,11 +368,15 @@ def _update_litellm_params_for_health_check(
"""
_NON_CHAT_MODES = {
"image_generation",
"image_edit",
"video_generation",
"embedding",
"rerank",
"transcription",
"audio_transcription",
"audio_speech",
"ocr",
"search",
"moderation",
}
_mode = model_info.get("mode", None)
litellm_params["messages"] = _get_random_llm_message()

View file

@ -90,11 +90,15 @@ async def test_ahealth_check_wildcard_models_respects_max_tokens():
"mode",
[
"image_generation",
"image_edit",
"video_generation",
"embedding",
"rerank",
"transcription",
"audio_transcription",
"audio_speech",
"ocr",
"search",
"moderation",
],
)
@pytest.mark.asyncio