diff --git a/litellm/llms/openai/common_utils.py b/litellm/llms/openai/common_utils.py index a89f7f9c2b..a05482c800 100644 --- a/litellm/llms/openai/common_utils.py +++ b/litellm/llms/openai/common_utils.py @@ -168,12 +168,12 @@ class BaseOpenAILLM: f"is_async={client_initialization_params.get('is_async')}", ] - LITELLM_CLIENT_SPECIFIC_PARAMS = [ + LITELLM_CLIENT_SPECIFIC_PARAMS = ( "timeout", "max_retries", "organization", "api_base", - ] + ) openai_client_fields = ( BaseOpenAILLM.get_openai_client_initialization_param_fields( client_type=client_type diff --git a/tests/test_litellm/llms/openai/test_openai_common_utils.py b/tests/test_litellm/llms/openai/test_openai_common_utils.py index d0dedd3ed9..8489040660 100644 --- a/tests/test_litellm/llms/openai/test_openai_common_utils.py +++ b/tests/test_litellm/llms/openai/test_openai_common_utils.py @@ -164,3 +164,14 @@ def test_get_openai_client_initialization_param_fields(client_type): assert isinstance(result, tuple) assert len(result) > 0 assert "self" not in result + + +@pytest.mark.parametrize("client_type", ["openai", "azure"]) +def test_get_openai_client_cache_key(client_type): + """Verify get_openai_client_cache_key doesn't raise on tuple + tuple concatenation.""" + key = BaseOpenAILLM.get_openai_client_cache_key( + client_initialization_params={"api_key": "sk-test"}, + client_type=client_type, + ) + assert isinstance(key, str) + assert "api_key=sk-test" in key