
    	h|                      d dl mZ d dlmZmZmZmZ d dlmZm	Z	 d dl
Z
ddlmZ ddlmZmZmZ ddlmZmZmZmZmZmZmZ dd	lmZmZmZmZmZ dd
lm Z  ddl!m"Z"m#Z# ddl$m%Z%m&Z& ddl'm(Z(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddgZ4 G d de"          Z5 G d de#          Z6 G d d          Z7 G d d          Z8 G d d          Z9 G d d          Z:dS )    )annotations)UnionMappingOptionalcast)LiteraloverloadN   )_legacy_response)image_edit_paramsimage_generate_paramsimage_create_variation_params)	NOT_GIVENBodyQueryHeadersNotGiven	FileTypesSequenceNotStr)extract_filesrequired_argsmaybe_transformdeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)StreamAsyncStream)make_request_options)
ImageModel)ImagesResponse)ImageGenStreamEvent)ImageEditStreamEventImagesAsyncImagesc                  z   e Zd ZedJd            ZedKd            Zeeeeeddded	dLdZeeeeeeeeeeeeeedddeddMd1            Z	eeeeeeeeeeeeeddded2dNd5            Z	eeeeeeeeeeeeeddded2dOd8            Z	 e
dd gg d9          eeeeeeeeeeeeedddeddPd;            Z	eeeeeeeeeeeeeeddded<dQdC            ZeeeeeeeeeeeeedddedDdRdF            ZeeeeeeeeeeeeedddedDdSdH            Z e
d gd d/g          eeeeeeeeeeeeeddded<dTdI            ZdS )Ur'   returnImagesWithRawResponsec                     t          |           S a  
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
        )r+   selfs    d/var/www/html/web-builder-api.evdpl.com/venv/lib/python3.11/site-packages/openai/resources/images.pywith_raw_responsezImages.with_raw_response   s     %T***    ImagesWithStreamingResponsec                     t          |           S z
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )r3   r.   s    r0   with_streaming_responsezImages.with_streaming_response&   s     +4000r2   N	modelnresponse_formatsizeuserextra_headersextra_query
extra_bodytimeoutimager   r8   'Union[str, ImageModel, None] | NotGivenr9   Optional[int] | NotGivenr:   /Optional[Literal['url', 'b64_json']] | NotGivenr;   ?Optional[Literal['256x256', '512x512', '1024x1024']] | NotGivenr<   str | NotGivenr=   Headers | Noner>   Query | Noner?   Body | Noner@   'float | httpx.Timeout | None | NotGivenr$   c       
        >   t          ||||||d          }t          t          t          t          t
          f         |          dgg          }ddi|pi }|                     dt          |t          j	                  |t          |||	|
          t                    S )	   Creates a variation of a given image.

        This endpoint only supports `dall-e-2`.

        Args:
          image: The image to use as the basis for the variation(s). Must be a valid PNG file,
              less than 4MB, and square.

          model: The model to use for image generation. Only `dall-e-2` is supported at this
              time.

          n: The number of images to generate. Must be between 1 and 10.

          response_format: The format in which the generated images are returned. Must be one of `url` or
              `b64_json`. URLs are only valid for 60 minutes after the image has been
              generated.

          size: The size of the generated images. Must be one of `256x256`, `512x512`, or
              `1024x1024`.

          user: A unique identifier representing your end-user, which can help OpenAI to monitor
              and detect abuse.
              [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        rA   r8   r9   r:   r;   r<   rA   pathsContent-Typemultipart/form-data/images/variationsr=   r>   r?   r@   bodyfilesoptionscast_to)r   r   r   r   strobject_postr   r   ImageCreateVariationParamsr"   r$   r/   rA   r8   r9   r:   r;   r<   r=   r>   r?   r@   rU   rV   s                r0   create_variationzImages.create_variation/   s    `  #2 	
 	
 d73;#7>>ykRRR ()>X=CVTVXzz  'D'_``(+Q[el   #  
 
 	
r2   
backgroundinput_fidelitymaskr8   r9   output_compressionoutput_formatpartial_imagesqualityr:   r;   streamr<   r=   r>   r?   r@   +Union[FileTypes, SequenceNotStr[FileTypes]]promptrY   r`   =Optional[Literal['transparent', 'opaque', 'auto']] | NotGivenra   +Optional[Literal['high', 'low']] | NotGivenrb   FileTypes | NotGivenrc   rd   3Optional[Literal['png', 'jpeg', 'webp']] | NotGivenre   rf   IOptional[Literal['standard', 'low', 'medium', 'high', 'auto']] | NotGivenaOptional[Literal['256x256', '512x512', '1024x1024', '1536x1024', '1024x1536', 'auto']] | NotGivenrg   #Optional[Literal[False]] | NotGivenc                   dS a  Creates an edited or extended image given one or more source images and a
        prompt.

        This endpoint only supports `gpt-image-1` and `dall-e-2`.

        Args:
          image: The image(s) to edit. Must be a supported image file or an array of images.

              For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than
              50MB. You can provide up to 16 images.

              For `dall-e-2`, you can only provide one image, and it should be a square `png`
              file less than 4MB.

          prompt: A text description of the desired image(s). The maximum length is 1000
              characters for `dall-e-2`, and 32000 characters for `gpt-image-1`.

          background: Allows to set transparency for the background of the generated image(s). This
              parameter is only supported for `gpt-image-1`. Must be one of `transparent`,
              `opaque` or `auto` (default value). When `auto` is used, the model will
              automatically determine the best background for the image.

              If `transparent`, the output format needs to support transparency, so it should
              be set to either `png` (default value) or `webp`.

          input_fidelity: Control how much effort the model will exert to match the style and features,
              especially facial features, of input images. This parameter is only supported
              for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`.

          mask: An additional image whose fully transparent areas (e.g. where alpha is zero)
              indicate where `image` should be edited. If there are multiple images provided,
              the mask will be applied on the first image. Must be a valid PNG file, less than
              4MB, and have the same dimensions as `image`.

          model: The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are
              supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1`
              is used.

          n: The number of images to generate. Must be between 1 and 10.

          output_compression: The compression level (0-100%) for the generated images. This parameter is only
              supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and
              defaults to 100.

          output_format: The format in which the generated images are returned. This parameter is only
              supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. The
              default value is `png`.

          partial_images: The number of partial images to generate. This parameter is used for streaming
              responses that return partial images. Value must be between 0 and 3. When set to
              0, the response will be a single image sent in one streaming event.

              Note that the final image may be sent before the full number of partial images
              are generated if the full image is generated more quickly.

          quality: The quality of the image that will be generated. `high`, `medium` and `low` are
              only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality.
              Defaults to `auto`.

          response_format: The format in which the generated images are returned. Must be one of `url` or
              `b64_json`. URLs are only valid for 60 minutes after the image has been
              generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1`
              will always return base64-encoded images.

          size: The size of the generated images. Must be one of `1024x1024`, `1536x1024`
              (landscape), `1024x1536` (portrait), or `auto` (default value) for
              `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`.

          stream: Edit the image in streaming mode. Defaults to `false`. See the
              [Image generation guide](https://platform.openai.com/docs/guides/image-generation)
              for more information.

          user: A unique identifier representing your end-user, which can help OpenAI to monitor
              and detect abuse.
              [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        N r/   rA   ri   r`   ra   rb   r8   r9   rc   rd   re   rf   r:   r;   rg   r<   r=   r>   r?   r@   s                       r0   editzImages.editx   
    ^ 	r2   r`   ra   rb   r8   r9   rc   rd   re   rf   r:   r;   r<   r=   r>   r?   r@   Literal[True]Stream[ImageEditStreamEvent]c                   dS a  Creates an edited or extended image given one or more source images and a
        prompt.

        This endpoint only supports `gpt-image-1` and `dall-e-2`.

        Args:
          image: The image(s) to edit. Must be a supported image file or an array of images.

              For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than
              50MB. You can provide up to 16 images.

              For `dall-e-2`, you can only provide one image, and it should be a square `png`
              file less than 4MB.

          prompt: A text description of the desired image(s). The maximum length is 1000
              characters for `dall-e-2`, and 32000 characters for `gpt-image-1`.

          stream: Edit the image in streaming mode. Defaults to `false`. See the
              [Image generation guide](https://platform.openai.com/docs/guides/image-generation)
              for more information.

          background: Allows to set transparency for the background of the generated image(s). This
              parameter is only supported for `gpt-image-1`. Must be one of `transparent`,
              `opaque` or `auto` (default value). When `auto` is used, the model will
              automatically determine the best background for the image.

              If `transparent`, the output format needs to support transparency, so it should
              be set to either `png` (default value) or `webp`.

          input_fidelity: Control how much effort the model will exert to match the style and features,
              especially facial features, of input images. This parameter is only supported
              for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`.

          mask: An additional image whose fully transparent areas (e.g. where alpha is zero)
              indicate where `image` should be edited. If there are multiple images provided,
              the mask will be applied on the first image. Must be a valid PNG file, less than
              4MB, and have the same dimensions as `image`.

          model: The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are
              supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1`
              is used.

          n: The number of images to generate. Must be between 1 and 10.

          output_compression: The compression level (0-100%) for the generated images. This parameter is only
              supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and
              defaults to 100.

          output_format: The format in which the generated images are returned. This parameter is only
              supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. The
              default value is `png`.

          partial_images: The number of partial images to generate. This parameter is used for streaming
              responses that return partial images. Value must be between 0 and 3. When set to
              0, the response will be a single image sent in one streaming event.

              Note that the final image may be sent before the full number of partial images
              are generated if the full image is generated more quickly.

          quality: The quality of the image that will be generated. `high`, `medium` and `low` are
              only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality.
              Defaults to `auto`.

          response_format: The format in which the generated images are returned. Must be one of `url` or
              `b64_json`. URLs are only valid for 60 minutes after the image has been
              generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1`
              will always return base64-encoded images.

          size: The size of the generated images. Must be one of `1024x1024`, `1536x1024`
              (landscape), `1024x1536` (portrait), or `auto` (default value) for
              `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`.

          user: A unique identifier representing your end-user, which can help OpenAI to monitor
              and detect abuse.
              [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        Nrs   r/   rA   ri   rg   r`   ra   rb   r8   r9   rc   rd   re   rf   r:   r;   r<   r=   r>   r?   r@   s                       r0   ru   zImages.edit   rv   r2   bool-ImagesResponse | Stream[ImageEditStreamEvent]c                   dS r{   rs   r|   s                       r0   ru   zImages.editZ  rv   r2   rA   ri   rg   3Optional[Literal[False]] | Literal[True] | NotGivenc                  t          |||||||||	|
|||||d          }t          t          t          t          t
          f         |          dgddgdgg          }ddi|pi }|                     dt          ||rt          j	        nt          j
                  |t          ||||	          t          |pd
t          t                             S N)rA   ri   r`   ra   rb   r8   r9   rc   rd   re   rf   r:   r;   rg   r<   rA   z<array>rb   rN   rP   rQ   z/images/editsrS   F)rU   rV   rW   rX   rg   
stream_cls)r   r   r   r   rY   rZ   r[   r   r   ImageEditParamsStreamingImageEditParamsNonStreamingr"   r$   r    r&   r/   rA   ri   r`   ra   rb   r8   r9   rc   rd   re   rf   r:   r;   rg   r<   r=   r>   r?   r@   rU   rV   s                         r0   ru   zImages.edit  s   6   ("0&8!."0"#2  
 
& d73;#7>>ySZ\eRfiohpFqrrr ()>X=CVTVXzz >Dw!::J[Jw  (+Q[el   #?U23  
 
 	
r2   r`   r8   
moderationr9   rc   rd   re   rf   r:   r;   rg   styler<   r=   r>   r?   r@   r   +Optional[Literal['low', 'auto']] | NotGivenOOptional[Literal['standard', 'hd', 'low', 'medium', 'high', 'auto']] | NotGiven{Optional[Literal['auto', '1024x1024', '1536x1024', '1024x1536', '256x256', '512x512', '1792x1024', '1024x1792']] | NotGivenr   0Optional[Literal['vivid', 'natural']] | NotGivenc                   dS a~  
        Creates an image given a prompt.
        [Learn more](https://platform.openai.com/docs/guides/images).

        Args:
          prompt: A text description of the desired image(s). The maximum length is 32000
              characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters
              for `dall-e-3`.

          background: Allows to set transparency for the background of the generated image(s). This
              parameter is only supported for `gpt-image-1`. Must be one of `transparent`,
              `opaque` or `auto` (default value). When `auto` is used, the model will
              automatically determine the best background for the image.

              If `transparent`, the output format needs to support transparency, so it should
              be set to either `png` (default value) or `webp`.

          model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or
              `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to
              `gpt-image-1` is used.

          moderation: Control the content-moderation level for images generated by `gpt-image-1`. Must
              be either `low` for less restrictive filtering or `auto` (default value).

          n: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only
              `n=1` is supported.

          output_compression: The compression level (0-100%) for the generated images. This parameter is only
              supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and
              defaults to 100.

          output_format: The format in which the generated images are returned. This parameter is only
              supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`.

          partial_images: The number of partial images to generate. This parameter is used for streaming
              responses that return partial images. Value must be between 0 and 3. When set to
              0, the response will be a single image sent in one streaming event.

              Note that the final image may be sent before the full number of partial images
              are generated if the full image is generated more quickly.

          quality: The quality of the image that will be generated.

              - `auto` (default value) will automatically select the best quality for the
                given model.
              - `high`, `medium` and `low` are supported for `gpt-image-1`.
              - `hd` and `standard` are supported for `dall-e-3`.
              - `standard` is the only option for `dall-e-2`.

          response_format: The format in which generated images with `dall-e-2` and `dall-e-3` are
              returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
              after the image has been generated. This parameter isn't supported for
              `gpt-image-1` which will always return base64-encoded images.

          size: The size of the generated images. Must be one of `1024x1024`, `1536x1024`
              (landscape), `1024x1536` (portrait), or `auto` (default value) for
              `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and
              one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.

          stream: Generate the image in streaming mode. Defaults to `false`. See the
              [Image generation guide](https://platform.openai.com/docs/guides/image-generation)
              for more information. This parameter is only supported for `gpt-image-1`.

          style: The style of the generated images. This parameter is only supported for
              `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
              towards generating hyper-real and dramatic images. Natural causes the model to
              produce more natural, less hyper-real looking images.

          user: A unique identifier representing your end-user, which can help OpenAI to monitor
              and detect abuse.
              [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        Nrs   r/   ri   r`   r8   r   r9   rc   rd   re   rf   r:   r;   rg   r   r<   r=   r>   r?   r@   s                      r0   generatezImages.generate  
    X 	r2   r`   r8   r   r9   rc   rd   re   rf   r:   r;   r   r<   r=   r>   r?   r@   Stream[ImageGenStreamEvent]c                   dS a~  
        Creates an image given a prompt.
        [Learn more](https://platform.openai.com/docs/guides/images).

        Args:
          prompt: A text description of the desired image(s). The maximum length is 32000
              characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters
              for `dall-e-3`.

          stream: Generate the image in streaming mode. Defaults to `false`. See the
              [Image generation guide](https://platform.openai.com/docs/guides/image-generation)
              for more information. This parameter is only supported for `gpt-image-1`.

          background: Allows to set transparency for the background of the generated image(s). This
              parameter is only supported for `gpt-image-1`. Must be one of `transparent`,
              `opaque` or `auto` (default value). When `auto` is used, the model will
              automatically determine the best background for the image.

              If `transparent`, the output format needs to support transparency, so it should
              be set to either `png` (default value) or `webp`.

          model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or
              `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to
              `gpt-image-1` is used.

          moderation: Control the content-moderation level for images generated by `gpt-image-1`. Must
              be either `low` for less restrictive filtering or `auto` (default value).

          n: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only
              `n=1` is supported.

          output_compression: The compression level (0-100%) for the generated images. This parameter is only
              supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and
              defaults to 100.

          output_format: The format in which the generated images are returned. This parameter is only
              supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`.

          partial_images: The number of partial images to generate. This parameter is used for streaming
              responses that return partial images. Value must be between 0 and 3. When set to
              0, the response will be a single image sent in one streaming event.

              Note that the final image may be sent before the full number of partial images
              are generated if the full image is generated more quickly.

          quality: The quality of the image that will be generated.

              - `auto` (default value) will automatically select the best quality for the
                given model.
              - `high`, `medium` and `low` are supported for `gpt-image-1`.
              - `hd` and `standard` are supported for `dall-e-3`.
              - `standard` is the only option for `dall-e-2`.

          response_format: The format in which generated images with `dall-e-2` and `dall-e-3` are
              returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
              after the image has been generated. This parameter isn't supported for
              `gpt-image-1` which will always return base64-encoded images.

          size: The size of the generated images. Must be one of `1024x1024`, `1536x1024`
              (landscape), `1024x1536` (portrait), or `auto` (default value) for
              `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and
              one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.

          style: The style of the generated images. This parameter is only supported for
              `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
              towards generating hyper-real and dramatic images. Natural causes the model to
              produce more natural, less hyper-real looking images.

          user: A unique identifier representing your end-user, which can help OpenAI to monitor
              and detect abuse.
              [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        Nrs   r/   ri   rg   r`   r8   r   r9   rc   rd   re   rf   r:   r;   r   r<   r=   r>   r?   r@   s                      r0   r   zImages.generate{  r   r2   ,ImagesResponse | Stream[ImageGenStreamEvent]c                   dS r   rs   r   s                      r0   r   zImages.generate  r   r2   c                   |                      dt          |||||||||	|
||||d|rt          j        nt          j                  t          ||||          t          |pdt          t                             S Nz/images/generations)ri   r`   r8   r   r9   rc   rd   re   rf   r:   r;   rg   r   r<   rS   F)rU   rW   rX   rg   r   )	r[   r   r   ImageGenerateParamsStreamingImageGenerateParamsNonStreamingr"   r$   r    r%   r   s                      r0   r   zImages.generateW  s    8 zz! $","",*<%2&4&'6 $"  " K%BB*J' * )+Q[el   #?U129  
 
 	
r2   )r*   r+   )r*   r3   rA   r   r8   rB   r9   rC   r:   rD   r;   rE   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r$   (rA   rh   ri   rY   r`   rj   ra   rk   rb   rl   r8   rB   r9   rC   rc   rC   rd   rm   re   rC   rf   rn   r:   rD   r;   ro   rg   rp   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r$   )(rA   rh   ri   rY   rg   rx   r`   rj   ra   rk   rb   rl   r8   rB   r9   rC   rc   rC   rd   rm   re   rC   rf   rn   r:   rD   r;   ro   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   ry   )(rA   rh   ri   rY   rg   r}   r`   rj   ra   rk   rb   rl   r8   rB   r9   rC   rc   rC   rd   rm   re   rC   rf   rn   r:   rD   r;   ro   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r~   )(rA   rh   ri   rY   r`   rj   ra   rk   rb   rl   r8   rB   r9   rC   rc   rC   rd   rm   re   rC   rf   rn   r:   rD   r;   ro   rg   r   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r~   &ri   rY   r`   rj   r8   rB   r   r   r9   rC   rc   rC   rd   rm   re   rC   rf   r   r:   rD   r;   r   rg   rp   r   r   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r$   )&ri   rY   rg   rx   r`   rj   r8   rB   r   r   r9   rC   rc   rC   rd   rm   re   rC   rf   r   r:   rD   r;   r   r   r   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r   )&ri   rY   rg   r}   r`   rj   r8   rB   r   r   r9   rC   rc   rC   rd   rm   re   rC   rf   r   r:   rD   r;   r   r   r   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r   )&ri   rY   r`   rj   r8   rB   r   r   r9   rC   rc   rC   rd   rm   re   rC   rf   r   r:   rD   r;   r   rg   r   r   r   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r   __name__
__module____qualname__r   r1   r6   r   r^   r	   ru   r   r   rs   r2   r0   r'   r'      s       + + + _+ 1 1 1 _1 :C&/KTPY( )-$("&;DG
 G
 G
 G
 G
 G
R  U^FO%.9B&/7@MV3<]fKT6?( )-$("&;D1n n n n n Xn`  U^FO%.9B&/7@MV3<]fKT( )-$("&;D1n n n n n Xn`  U^FO%.9B&/7@MV3<]fKT( )-$("&;D1n n n n n Xn` ]GX&(E(E(EFF U^FO%.9B&/7@MV3<]fKTFO( )-$("&;D1?
 ?
 ?
 ?
 ?
 GF?
B 
 U^9BBK&/7@MV3<clKT 6?BK( )-$("&;D3k k k k k XkZ  U^9BBK&/7@MV3<clKT BK( )-$("&;D3k k k k k XkZ  U^9BBK&/7@MV3<clKT BK( )-$("&;D3k k k k k XkZ ]H:(344
 U^9BBK&/7@MV3<clKT FOBK( )-$("&;D38
 8
 8
 8
 8
 548
 8
 8
r2   c                  z   e Zd ZedJd            ZedKd            Zeeeeeddded	dLdZeeeeeeeeeeeeeedddeddMd1            Z	eeeeeeeeeeeeeddded2dNd5            Z	eeeeeeeeeeeeeddded2dOd8            Z	 e
dd gg d9          eeeeeeeeeeeeedddeddPd;            Z	eeeeeeeeeeeeeeddded<dQdC            ZeeeeeeeeeeeeedddedDdRdF            ZeeeeeeeeeeeeedddedDdSdH            Z e
d gd d/g          eeeeeeeeeeeeeddded<dTdI            ZdS )Ur(   r*   AsyncImagesWithRawResponsec                     t          |           S r-   )r   r.   s    r0   r1   zAsyncImages.with_raw_response  s     *$///r2    AsyncImagesWithStreamingResponsec                     t          |           S r5   )r   r.   s    r0   r6   z#AsyncImages.with_streaming_response  s     0555r2   Nr7   rA   r   r8   rB   r9   rC   r:   rD   r;   rE   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r$   c       
        Z  K   t          ||||||d          }t          t          t          t          t
          f         |          dgg          }ddi|pi }|                     dt          |t          j	                   d{V |t          |||	|
          t          	           d{V S )
rL   rM   rA   rN   rP   rQ   rR   NrS   rT   )r   r   r   r   rY   rZ   r[   r   r   r\   r"   r$   r]   s                r0   r^   zAsyncImages.create_variation  s      `  #2 	
 	
 d73;#7>>ykRRR ()>X=CVTVXZZ ,T3P3kllllllll(+Q[el   #   
 
 
 
 
 
 
 
 	
r2   r_   rh   ri   rY   r`   rj   ra   rk   rb   rl   rc   rd   rm   re   rf   rn   ro   rg   rp   c               
   K   dS rr   rs   rt   s                       r0   ru   zAsyncImages.edit        ^ 	r2   rw   rx   !AsyncStream[ImageEditStreamEvent]c               
   K   dS r{   rs   r|   s                       r0   ru   zAsyncImages.edita  r   r2   r}   2ImagesResponse | AsyncStream[ImageEditStreamEvent]c               
   K   dS r{   rs   r|   s                       r0   ru   zAsyncImages.edit  r   r2   r   r   c                 K   t          |||||||||	|
|||||d          }t          t          t          t          t
          f         |          dgddgdgg          }ddi|pi }|                     dt          ||rt          j	        nt          j
                   d {V |t          ||||	          t          |pd
t          t                              d {V S r   )r   r   r   r   rY   rZ   r[   r   r   r   r   r"   r$   r!   r&   r   s                         r0   ru   zAsyncImages.editC  sW     6   ("0&8!."0"#2  
 
& d73;#7>>ySZ\eRfiohpFqrrr ()>X=CVTVXZZ,>Dw!::J[Jw        (+Q[el   #?U"#78   
 
 
 
 
 
 
 
 	
r2   r   r   r   r   r   r   r   c               
   K   dS r   rs   r   s                      r0   r   zAsyncImages.generate        X 	r2   r    AsyncStream[ImageGenStreamEvent]c               
   K   dS r   rs   r   s                      r0   r   zAsyncImages.generate  r   r2   1ImagesResponse | AsyncStream[ImageGenStreamEvent]c               
   K   dS r   rs   r   s                      r0   r   zAsyncImages.generatea  r   r2   c                 K   |                      dt          |||||||||	|
||||d|rt          j        nt          j                   d {V t          ||||          t          |pdt          t                              d {V S r   )	r[   r   r   r   r   r"   r$   r!   r%   r   s                      r0   r   zAsyncImages.generate  s      8 ZZ!,$","",*<%2&4&'6 $"  " K%BB*J'       * )+Q[el   #?U"#679   
 
 
 
 
 
 
 
 	
r2   )r*   r   )r*   r   r   r   )(rA   rh   ri   rY   rg   rx   r`   rj   ra   rk   rb   rl   r8   rB   r9   rC   rc   rC   rd   rm   re   rC   rf   rn   r:   rD   r;   ro   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r   )(rA   rh   ri   rY   rg   r}   r`   rj   ra   rk   rb   rl   r8   rB   r9   rC   rc   rC   rd   rm   re   rC   rf   rn   r:   rD   r;   ro   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r   )(rA   rh   ri   rY   r`   rj   ra   rk   rb   rl   r8   rB   r9   rC   rc   rC   rd   rm   re   rC   rf   rn   r:   rD   r;   ro   rg   r   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r   r   )&ri   rY   rg   rx   r`   rj   r8   rB   r   r   r9   rC   rc   rC   rd   rm   re   rC   rf   r   r:   rD   r;   r   r   r   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r   )&ri   rY   rg   r}   r`   rj   r8   rB   r   r   r9   rC   rc   rC   rd   rm   re   rC   rf   r   r:   rD   r;   r   r   r   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r   )&ri   rY   r`   rj   r8   rB   r   r   r9   rC   rc   rC   rd   rm   re   rC   rf   r   r:   rD   r;   r   rg   r   r   r   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   r*   r   r   rs   r2   r0   r(   r(     s       0 0 0 _0 6 6 6 _6 :C&/KTPY( )-$("&;DG
 G
 G
 G
 G
 G
R  U^FO%.9B&/7@MV3<]fKT6?( )-$("&;D1n n n n n Xn`  U^FO%.9B&/7@MV3<]fKT( )-$("&;D1n n n n n Xn`  U^FO%.9B&/7@MV3<]fKT( )-$("&;D1n n n n n Xn` ]GX&(E(E(EFF U^FO%.9B&/7@MV3<]fKTFO( )-$("&;D1?
 ?
 ?
 ?
 ?
 GF?
B 
 U^9BBK&/7@MV3<clKT 6?BK( )-$("&;D3k k k k k XkZ  U^9BBK&/7@MV3<clKT BK( )-$("&;D3k k k k k XkZ  U^9BBK&/7@MV3<clKT BK( )-$("&;D3k k k k k XkZ ]H:(344
 U^9BBK&/7@MV3<clKT FOBK( )-$("&;D38
 8
 8
 8
 8
 548
 8
 8
r2   c                      e Zd ZddZdS )r+   imagesr'   r*   Nonec                    || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S N)_imagesr   to_raw_response_wrapperr^   ru   r   r/   r   s     r0   __init__zImagesWithRawResponse.__init__  s^     0 H#!
 !
 %<K
 
	 )@O
 
r2   Nr   r'   r*   r   r   r   r   r   rs   r2   r0   r+   r+     (        
 
 
 
 
 
r2   r+   c                      e Zd ZddZdS )r   r   r(   r*   r   c                    || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r   )r   r   async_to_raw_response_wrapperr^   ru   r   r   s     r0   r   z#AsyncImagesWithRawResponse.__init__  s^     0 N#!
 !
 %BK
 
	 )FO
 
r2   Nr   r(   r*   r   r   rs   r2   r0   r   r     r   r2   r   c                      e Zd ZddZdS )r3   r   r'   r*   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   r^   ru   r   r   s     r0   r   z$ImagesWithStreamingResponse.__init__*  sU     <#!
 !
 1K
 
	 5O
 
r2   Nr   r   rs   r2   r0   r3   r3   )  r   r2   r3   c                      e Zd ZddZdS )r   r   r(   r*   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   r^   ru   r   r   s     r0   r   z)AsyncImagesWithStreamingResponse.__init__9  sU     B#!
 !
 7K
 
	 ;O
 
r2   Nr   r   rs   r2   r0   r   r   8  r   r2   r   );
__future__r   typingr   r   r   r   typing_extensionsr   r	   httpx r   typesr   r   r   _typesr   r   r   r   r   r   r   _utilsr   r   r   r   r   _compatr   	_resourcer   r   	_responser   r   
_streamingr    r!   _base_clientr"   types.image_modelr#   types.images_responser$   types.image_gen_stream_eventr%   types.image_edit_stream_eventr&   __all__r'   r(   r+   r   r3   r   rs   r2   r0   <module>r      s   # " " " " " 1 1 1 1 1 1 1 1 1 1 1 1 / / / / / / / /        [ [ [ [ [ [ [ [ [ [ Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y k k k k k k k k k k k k k k % % % % % % 9 9 9 9 9 9 9 9 X X X X X X X X , , , , , , , , / / / / / / * * * * * * 2 2 2 2 2 2 > > > > > > @ @ @ @ @ @]
#u
 u
 u
 u
 u
_ u
 u
 u
pu
 u
 u
 u
 u
" u
 u
 u
p
 
 
 
 
 
 
 

 
 
 
 
 
 
 

 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
r2   