11from typing import Any , Dict , List , Union , cast
2- from typing_extensions import NotRequired , TypedDict , Literal
2+ from typing_extensions import NotRequired , TypedDict , Literal , Required
33from .request import Request , RequestConfig
44from .async_request import AsyncRequest
55
66from typing import List , Union
77from ._config import ClientConfig
88
9- class ImageGenerationparams (TypedDict ):
10- prompt : str
9+ class ImageGenerationParams (TypedDict ):
10+ prompt : Required [ str ]
1111 """"
1212 The text to generate the image from."
1313 """
14- aspect_ratio : Literal ["1:1" , "16:9" , "21:9" , "3:2" , "2:3" , "4:5" , "5:4" , "3:4" , "4:3" , "9:16" , "9:21" ]
14+ aspect_ratio : NotRequired [ Literal ["1:1" , "16:9" , "21:9" , "3:2" , "2:3" , "4:5" , "5:4" , "3:4" , "4:3" , "9:16" , "9:21" ] ]
1515 """
1616 The aspect ratio of the image. The default is 1:1.
1717 """
@@ -62,7 +62,7 @@ def __init__(
6262 disable_request_logging = disable_request_logging ,
6363 )
6464
65- def image_generation (self , params : ImageGenerationparams ) -> ImageGenerationResponse :
65+ def image_generation (self , params : ImageGenerationParams ) -> ImageGenerationResponse :
6666 path = "/ai/image_generation"
6767 resp = Request (
6868 config = self .config ,
@@ -88,7 +88,7 @@ def __init__(
8888 disable_request_logging = disable_request_logging ,
8989 )
9090
91- async def image_generation (self , params : ImageGenerationparams ) -> ImageGenerationResponse :
91+ async def image_generation (self , params : ImageGenerationParams ) -> ImageGenerationResponse :
9292 path = "/ai/image_generation"
9393 resp = await AsyncRequest (
9494 config = self .config ,
0 commit comments