From 7c8ed6d1006e8e3981e692342f53d577437c979d Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Mon, 8 Jun 2026 11:59:46 +0530 Subject: [PATCH] fix(azure_ai): narrow MAI edit size param type for mypy Co-authored-by: Cursor --- litellm/llms/azure_ai/image_edit/mai_transformation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/litellm/llms/azure_ai/image_edit/mai_transformation.py b/litellm/llms/azure_ai/image_edit/mai_transformation.py index da1da0c6e98..75bfc913a8f 100644 --- a/litellm/llms/azure_ai/image_edit/mai_transformation.py +++ b/litellm/llms/azure_ai/image_edit/mai_transformation.py @@ -1,4 +1,4 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, cast import httpx from httpx._types import RequestFiles @@ -43,8 +43,9 @@ class AzureFoundryMAIImageEditConfig(OpenAIImageEditConfig): if key in supported_params: if key == "size" and value: - self._validate_size_param(value) - optional_params[key] = value + size_param = cast(str, value) + self._validate_size_param(size_param) + optional_params[key] = size_param else: optional_params[key] = value elif not drop_params: