diff --git a/litellm/llms/azure_ai/image_generation/cost_calculator.py b/litellm/llms/azure_ai/image_generation/cost_calculator.py index 10c75c9665b..274eb9facc4 100644 --- a/litellm/llms/azure_ai/image_generation/cost_calculator.py +++ b/litellm/llms/azure_ai/image_generation/cost_calculator.py @@ -38,7 +38,7 @@ def cost_calculator( Azure AI image generation cost calculator """ if not isinstance(image_response, ImageResponse): - raise ValueError(f"image_response must be of type ImageResponse got type={type(image_response)}") + raise TypeError(f"image_response must be of type ImageResponse got type={type(image_response)}") resolved: Final = resolve_image_model_info( model=model, diff --git a/tests/test_litellm/llms/azure_ai/image_generation/test_cost_calculator.py b/tests/test_litellm/llms/azure_ai/image_generation/test_azure_ai_image_generation_cost_calculator.py similarity index 98% rename from tests/test_litellm/llms/azure_ai/image_generation/test_cost_calculator.py rename to tests/test_litellm/llms/azure_ai/image_generation/test_azure_ai_image_generation_cost_calculator.py index 4f5278fc750..ce6d0001659 100644 --- a/tests/test_litellm/llms/azure_ai/image_generation/test_cost_calculator.py +++ b/tests/test_litellm/llms/azure_ai/image_generation/test_azure_ai_image_generation_cost_calculator.py @@ -161,5 +161,5 @@ def test_unlisted_model_bills_deployment_rates() -> None: def test_non_image_response_raises() -> None: - with pytest.raises(ValueError, match="must be of type ImageResponse"): + with pytest.raises(TypeError, match="must be of type ImageResponse"): cost_calculator(model="FLUX.2-flex", image_response=object())