From 67f4e96697b19a72a4c9b952678e73a1877d7397 Mon Sep 17 00:00:00 2001 From: ANISAYAK MITRA <266799942+anisayakmitra-in@users.noreply.github.com> Date: Sat, 24 Oct 2026 20:32:05 +0530 Subject: [PATCH] fix(openai_like): catch specific unmapped model exceptions to pass ruff strict gate --- litellm/llms/openai_like/dynamic_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/llms/openai_like/dynamic_config.py b/litellm/llms/openai_like/dynamic_config.py index af870bde38e..6cfcd17e85d 100644 --- a/litellm/llms/openai_like/dynamic_config.py +++ b/litellm/llms/openai_like/dynamic_config.py @@ -99,6 +99,7 @@ def create_config_class(provider: SimpleProviderConfig): def get_supported_openai_params(self, model: str) -> list: """Get supported OpenAI params, excluding tool-related params for models that don't support function calling.""" + from litellm.exceptions import ModelNotMappedError from litellm.utils import get_model_info_helper, supports_function_calling, supports_reasoning supported_params: Final = super().get_supported_openai_params(model=model) @@ -115,7 +116,7 @@ def create_config_class(provider: SimpleProviderConfig): # If model is mapped in the catalog, respect its capability declaration get_model_info_helper(model=model, custom_llm_provider=provider.slug) _supports_fc = supports_function_calling(model=model, custom_llm_provider=provider.slug) - except Exception: + except (ModelNotMappedError, KeyError, ValueError): # Unmapped models on OpenAI-compatible providers default to supporting tools _supports_fc = True