diff --git a/litellm/llms/azure/image_edit/transformation.py b/litellm/llms/azure/image_edit/transformation.py index ac2fe2cf60..321c2dee4e 100644 --- a/litellm/llms/azure/image_edit/transformation.py +++ b/litellm/llms/azure/image_edit/transformation.py @@ -1,4 +1,4 @@ -from typing import Dict, Optional, cast +from typing import Optional, cast import httpx diff --git a/tests/image_gen_tests/test_image_edits.py b/tests/image_gen_tests/test_image_edits.py index 3504065a10..dcb04c597e 100644 --- a/tests/image_gen_tests/test_image_edits.py +++ b/tests/image_gen_tests/test_image_edits.py @@ -244,7 +244,7 @@ async def test_openai_image_edit_with_bytesio(): @pytest.mark.asyncio async def test_azure_image_edit_litellm_sdk(): """Test Azure image edit with mocked httpx request to validate request body and URL""" - from litellm import image_edit, aimage_edit + from litellm import aimage_edit # Mock response for Azure image edit mock_response = { @@ -316,12 +316,11 @@ async def test_azure_image_edit_litellm_sdk(): list(form_data.keys()) if hasattr(form_data, "keys") else "Not a dict", ) - # Validate that model and prompt are in the form data - assert "model" in form_data, "model should be in form data" - assert "prompt" in form_data, "prompt should be in form data" + # Deployment is in the URL path; Azure rejects model in multipart for this route. assert ( - form_data["model"] == "gpt-image-1" - ), f"Expected model 'gpt-image-1', got {form_data['model']}" + "model" not in form_data + ), "model must not be in form data for Azure /openai/deployments/.../images/edits" + assert "prompt" in form_data, "prompt should be in the form data" assert ( prompt.strip() in form_data["prompt"] ), f"Expected prompt to contain '{prompt.strip()}'"