refactor: move _NON_CHAT_MODES to module-level constant

This commit is contained in:
Udit 2026-04-27 23:13:26 +05:30
parent a78fa80824
commit 500b2a4903
No known key found for this signature in database
GPG key ID: FCF5DBA5D134B6C8

View file

@ -32,6 +32,19 @@ ILLEGAL_DISPLAY_PARAMS = [
MINIMAL_DISPLAY_PARAMS = ["model", "mode_error"]
_NON_CHAT_MODES = {
"image_generation",
"image_edit",
"video_generation",
"embedding",
"rerank",
"audio_transcription",
"audio_speech",
"ocr",
"search",
"moderation",
}
def _get_process_rss_mb() -> Optional[float]:
"""
@ -366,18 +379,6 @@ def _update_litellm_params_for_health_check(
- updates the `voice` param with the `health_check_voice` for `audio_speech` mode if it exists Doc: https://docs.litellm.ai/docs/proxy/health#text-to-speech-models
- for Bedrock models with region routing (bedrock/region/model), strips the litellm routing prefix but preserves the model ID
"""
_NON_CHAT_MODES = {
"image_generation",
"image_edit",
"video_generation",
"embedding",
"rerank",
"audio_transcription",
"audio_speech",
"ocr",
"search",
"moderation",
}
_mode = model_info.get("mode", None)
litellm_params["messages"] = _get_random_llm_message()
if _mode not in _NON_CHAT_MODES: