diff --git a/litellm/proxy/image_endpoints/endpoints.py b/litellm/proxy/image_endpoints/endpoints.py index 1e8cc40c4f7..76cfaca5f5e 100644 --- a/litellm/proxy/image_endpoints/endpoints.py +++ b/litellm/proxy/image_endpoints/endpoints.py @@ -53,7 +53,7 @@ IMAGE_VARIATION_OPTIONAL_FIELD_DEFAULTS: Final = MappingProxyType({"image": None # ImageVariationRequestParams carries FileTypes (typing.IO[bytes]) which # pydantic cannot turn into a JSON schema, so the documented JSON body # schema is spelled out for the shape the multipart form accepts. -_IMAGE_VARIATION_REQUEST_BODY: Final = { +_IMAGE_VARIATION_REQUEST_BODY: Final[dict[str, object]] = { "required": True, "content": { "application/json": { @@ -71,7 +71,7 @@ _IMAGE_VARIATION_REQUEST_BODY: Final = { } }, } -_IMAGE_VARIATION_OPENAPI_EXTRA: Final = MappingProxyType({"requestBody": _IMAGE_VARIATION_REQUEST_BODY}) +_IMAGE_VARIATION_OPENAPI_EXTRA: Final[dict[str, object]] = {"requestBody": _IMAGE_VARIATION_REQUEST_BODY} IMAGE_ARRAY_FIELD: Final = "image[]" MASK_ARRAY_FIELD: Final = "mask[]" @@ -390,21 +390,21 @@ async def image_edit_api( "/v1/images/variations", dependencies=[Depends(user_api_key_auth)], responses={200: {"model": ImageResponse}}, - openapi_extra=dict(_IMAGE_VARIATION_OPENAPI_EXTRA), + openapi_extra=dict[str, object](_IMAGE_VARIATION_OPENAPI_EXTRA), tags=["images"], ) @router.post( "/images/variations", dependencies=[Depends(user_api_key_auth)], responses={200: {"model": ImageResponse}}, - openapi_extra=dict(_IMAGE_VARIATION_OPENAPI_EXTRA), + openapi_extra=dict[str, object](_IMAGE_VARIATION_OPENAPI_EXTRA), tags=["images"], ) @router.post( "/openai/deployments/{model:path}/images/variations", dependencies=[Depends(user_api_key_auth)], responses={200: {"model": ImageResponse}}, - openapi_extra=dict(_IMAGE_VARIATION_OPENAPI_EXTRA), + openapi_extra=dict[str, object](_IMAGE_VARIATION_OPENAPI_EXTRA), response_class=ORJSONResponse, ) # azure compatible endpoint async def image_variation_api(