o
    iCi|                    @  s  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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l0m1Z1 ddl2m3Z3 ddl4m5Z5 ddgZ6G dd de$Z7G dd de%Z8G dd dZ9G dd dZ:G dd dZ;G dd dZ<dS )    )annotations)UnionMappingOptionalcast)LiteraloverloadN   )_legacy_response)image_edit_paramsimage_generate_paramsimage_create_variation_params)	BodyOmitQueryHeadersNotGiven	FileTypesSequenceNotStromit	not_given)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                   @    e Zd ZedOddZedPddZeeeeeddded		dQdd Ze	eeeeeeeeeeeeeddded!dRd4d5Z
e	eeeeeeeeeeeeddded6dSd9d5Z
e	eeeeeeeeeeeeddded6dTd<d5Z
ed
d#gg d=eeeeeeeeeeeeeddded!dUd?d5Z
e	eeeeeeeeeeeeeddded@dVdGdHZe	eeeeeeeeeeeedddedIdWdKdHZe	eeeeeeeeeeeedddedIdXdMdHZed#gd#d2geeeeeeeeeeeeeddded@dYdNdHZdS )Zr(   returnImagesWithRawResponsec                 C     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,   self r1   o/var/www/html/fyndo/python/python_agents/rag_suite/venv/lib/python3.10/site-packages/openai/resources/images.pywith_raw_response      zImages.with_raw_responseImagesWithStreamingResponsec                 C  r-   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
        )r5   r/   r1   r1   r2   with_streaming_response&      zImages.with_streaming_responseN	modelnresponse_formatsizeuserextra_headersextra_query
extra_bodytimeoutimager   r:   #Union[str, ImageModel, None] | Omitr;   Optional[int] | Omitr<   +Optional[Literal['url', 'b64_json']] | Omitr=   ;Optional[Literal['256x256', '512x512', '1024x1024']] | Omitr>   
str | Omitr?   Headers | Noner@   Query | NonerA   Body | NonerB   'float | httpx.Timeout | None | NotGivenr%   c       
      
   C  sl   t ||||||d}tttttf |dggd}ddi|p i }| jdt|tj	|t
|||	|
dtd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
        rC   r:   r;   r<   r=   r>   rC   pathsContent-Typemultipart/form-data/images/variationsr?   r@   rA   rB   bodyfilesoptionscast_to)r   r   r   r   strobject_postr   r   ImageCreateVariationParamsr#   r%   r0   rC   r:   r;   r<   r=   r>   r?   r@   rA   rB   rV   rW   r1   r1   r2   create_variation/   s(   0

zImages.create_variation
backgroundinput_fidelitymaskr:   r;   output_compressionoutput_formatpartial_imagesqualityr<   r=   streamr>   r?   r@   rA   rB   +Union[FileTypes, SequenceNotStr[FileTypes]]promptrZ   ra   9Optional[Literal['transparent', 'opaque', 'auto']] | Omitrb   'Optional[Literal['high', 'low']] | Omitrc   FileTypes | Omitrd   re   /Optional[Literal['png', 'jpeg', 'webp']] | Omitrf   rg   EOptional[Literal['standard', 'low', 'medium', 'high', 'auto']] | Omit]Optional[Literal['256x256', '512x512', '1024x1024', '1536x1024', '1024x1536', 'auto']] | Omitrh   Optional[Literal[False]] | Omitc                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 the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and
              `gpt-image-1.5`), 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 the GPT image models.

          background: Allows to set transparency for the background of the generated image(s). This
              parameter is only supported for the GPT image models. 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`. Unsupported for `gpt-image-1-mini`. 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 the GPT image models
              are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT
              image models 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 the GPT image models 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 the GPT image models. 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 the GPT image models. `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 the GPT image
              models 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 the GPT image
              models, 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
        Nr1   r0   rC   rj   ra   rb   rc   r:   r;   rd   re   rf   rg   r<   r=   rh   r>   r?   r@   rA   rB   r1   r1   r2   editx      pzImages.editra   rb   rc   r:   r;   rd   re   rf   rg   r<   r=   r>   r?   r@   rA   rB   Literal[True]Stream[ImageEditStreamEvent]c                C  rr   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 the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and
              `gpt-image-1.5`), 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 the GPT image models.

          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 the GPT image models. 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`. Unsupported for `gpt-image-1-mini`. 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 the GPT image models
              are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT
              image models 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 the GPT image models 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 the GPT image models. 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 the GPT image models. `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 the GPT image
              models 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 the GPT image
              models, 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
        Nr1   r0   rC   rj   rh   ra   rb   rc   r:   r;   rd   re   rf   rg   r<   r=   r>   r?   r@   rA   rB   r1   r1   r2   ru      rv   bool-ImagesResponse | Stream[ImageEditStreamEvent]c                C  rr   rz   r1   r{   r1   r1   r2   ru   \  rv   rC   rj   rh   /Optional[Literal[False]] | Literal[True] | Omitc                C  s   t |||||||||	|
|||||d}tttttf |dgddgdggd}ddi|p.i }| jdt||r:tj	ntj
|t||||d	t|pId
tt dS N)rC   rj   ra   rb   rc   r:   r;   rd   re   rf   rg   r<   r=   rh   r>   rC   z<array>rc   rO   rQ   rR   z/images/editsrT   F)rV   rW   rX   rY   rh   
stream_cls)r   r   r   r   rZ   r[   r\   r   r   ImageEditParamsStreamingImageEditParamsNonStreamingr#   r%   r!   r'   r0   rC   rj   ra   rb   rc   r:   r;   rd   re   rf   rg   r<   r=   rh   r>   r?   r@   rA   rB   rV   rW   r1   r1   r2   ru     sD   (ra   r:   
moderationr;   rd   re   rf   rg   r<   r=   rh   styler>   r?   r@   rA   rB   r   'Optional[Literal['low', 'auto']] | OmitKOptional[Literal['standard', 'hd', 'low', 'medium', 'high', 'auto']] | OmitwOptional[Literal['auto', '1024x1024', '1536x1024', '1024x1536', '256x256', '512x512', '1792x1024', '1024x1792']] | Omitr   ,Optional[Literal['vivid', 'natural']] | Omitc                C  rr   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 the GPT image models, 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 the GPT image models. 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 a GPT
              image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to
              `dall-e-2` unless a parameter specific to the GPT image models is used.

          moderation: Control the content-moderation level for images generated by the GPT image
              models. 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 the GPT image models 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 the GPT image models. 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 the GPT image models.
              - `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 the GPT
              image models, which 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 the GPT image
              models, 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 the GPT image models.

          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
        Nr1   r0   rj   ra   r:   r   r;   rd   re   rf   rg   r<   r=   rh   r   r>   r?   r@   rA   rB   r1   r1   r2   generate     mzImages.generatera   r:   r   r;   rd   re   rf   rg   r<   r=   r   r>   r?   r@   rA   rB   Stream[ImageGenStreamEvent]c                C  rr   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 the GPT image models, 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 the GPT image models.

          background: Allows to set transparency for the background of the generated image(s). This
              parameter is only supported for the GPT image models. 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 a GPT
              image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to
              `dall-e-2` unless a parameter specific to the GPT image models is used.

          moderation: Control the content-moderation level for images generated by the GPT image
              models. 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 the GPT image models 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 the GPT image models. 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 the GPT image models.
              - `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 the GPT
              image models, which 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 the GPT image
              models, 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
        Nr1   r0   rj   rh   ra   r:   r   r;   rd   re   rf   rg   r<   r=   r   r>   r?   r@   rA   rB   r1   r1   r2   r   ~  r   ,ImagesResponse | Stream[ImageGenStreamEvent]c                C  rr   r   r1   r   r1   r1   r2   r     r   c                C  sZ   | j dt|||||||||	|
||||d|rtjntjt||||dt|p'dtt dS Nz/images/generations)rj   ra   r:   r   r;   rd   re   rf   rg   r<   r=   rh   r   r>   rT   F)rV   rX   rY   rh   r   )	r\   r   r   ImageGenerateParamsStreamingImageGenerateParamsNonStreamingr#   r%   r!   r&   r   r1   r1   r2   r   \  s:   )r+   r,   )r+   r5   rC   r   r:   rD   r;   rE   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r%   (rC   ri   rj   rZ   ra   rk   rb   rl   rc   rm   r:   rD   r;   rE   rd   rE   re   rn   rf   rE   rg   ro   r<   rF   r=   rp   rh   rq   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r%   )(rC   ri   rj   rZ   rh   rx   ra   rk   rb   rl   rc   rm   r:   rD   r;   rE   rd   rE   re   rn   rf   rE   rg   ro   r<   rF   r=   rp   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   ry   )(rC   ri   rj   rZ   rh   r|   ra   rk   rb   rl   rc   rm   r:   rD   r;   rE   rd   rE   re   rn   rf   rE   rg   ro   r<   rF   r=   rp   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r}   )(rC   ri   rj   rZ   ra   rk   rb   rl   rc   rm   r:   rD   r;   rE   rd   rE   re   rn   rf   rE   rg   ro   r<   rF   r=   rp   rh   r   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r}   &rj   rZ   ra   rk   r:   rD   r   r   r;   rE   rd   rE   re   rn   rf   rE   rg   r   r<   rF   r=   r   rh   rq   r   r   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r%   )&rj   rZ   rh   rx   ra   rk   r:   rD   r   r   r;   rE   rd   rE   re   rn   rf   rE   rg   r   r<   rF   r=   r   r   r   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r   )&rj   rZ   rh   r|   ra   rk   r:   rD   r   r   r;   rE   rd   rE   re   rn   rf   rE   rg   r   r<   rF   r=   r   r   r   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r   )&rj   rZ   ra   rk   r:   rD   r   r   r;   rE   rd   rE   re   rn   rf   rE   rg   r   r<   rF   r=   r   rh   r   r   r   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r   __name__
__module____qualname__r   r3   r7   r   r   r_   r   ru   r   r   r1   r1   r1   r2   r(      F   	Iqqq@nnnc                   @  r*   )Zr)   r+   AsyncImagesWithRawResponsec                 C  r-   r.   )r   r/   r1   r1   r2   r3     r4   zAsyncImages.with_raw_response AsyncImagesWithStreamingResponsec                 C  r-   r6   )r   r/   r1   r1   r2   r7     r8   z#AsyncImages.with_streaming_responseNr9   rC   r   r:   rD   r;   rE   r<   rF   r=   rG   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r%   c       
      
     sz   t ||||||d}tttttf |dggd}ddi|p!i }| jdt|tj	I dH |t
|||	|
dtd	I dH S )
rM   rN   rC   rO   rQ   rR   rS   NrT   rU   )r   r   r   r   rZ   r[   r\   r   r   r]   r#   r%   r^   r1   r1   r2   r_     s*   0
zAsyncImages.create_variationr`   ri   rj   rZ   ra   rk   rb   rl   rc   rm   rd   re   rn   rf   rg   ro   rp   rh   rq   c                     dS rs   r1   rt   r1   r1   r2   ru        pzAsyncImages.editrw   rx   !AsyncStream[ImageEditStreamEvent]c                  r   rz   r1   r{   r1   r1   r2   ru   g  r   r|   2ImagesResponse | AsyncStream[ImageEditStreamEvent]c                  r   rz   r1   r{   r1   r1   r2   ru     r   r~   r   c                  s   t |||||||||	|
|||||d}tttttf |dgddgdggd}ddi|p/i }| jdt||r;tj	ntj
I d H |t||||d	t|pMd
tt dI d H S r   )r   r   r   r   rZ   r[   r\   r   r   r   r   r#   r%   r"   r'   r   r1   r1   r2   ru   K  sF   (r   r   r   r   r   r   r   c                  r   r   r1   r   r1   r1   r2   r        mzAsyncImages.generater    AsyncStream[ImageGenStreamEvent]c                  r   r   r1   r   r1   r1   r2   r     r   1ImagesResponse | AsyncStream[ImageGenStreamEvent]c                  r   r   r1   r   r1   r1   r2   r   j  r   c                  sh   | j dt|||||||||	|
||||d|rtjntjI d H t||||dt|p+dtt dI d H S r   )	r\   r   r   r   r   r#   r%   r"   r&   r   r1   r1   r2   r     s<   )r+   r   )r+   r   r   r   )(rC   ri   rj   rZ   rh   rx   ra   rk   rb   rl   rc   rm   r:   rD   r;   rE   rd   rE   re   rn   rf   rE   rg   ro   r<   rF   r=   rp   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r   )(rC   ri   rj   rZ   rh   r|   ra   rk   rb   rl   rc   rm   r:   rD   r;   rE   rd   rE   re   rn   rf   rE   rg   ro   r<   rF   r=   rp   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r   )(rC   ri   rj   rZ   ra   rk   rb   rl   rc   rm   r:   rD   r;   rE   rd   rE   re   rn   rf   rE   rg   ro   r<   rF   r=   rp   rh   r   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r   r   )&rj   rZ   rh   rx   ra   rk   r:   rD   r   r   r;   rE   rd   rE   re   rn   rf   rE   rg   r   r<   rF   r=   r   r   r   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r   )&rj   rZ   rh   r|   ra   rk   r:   rD   r   r   r;   rE   rd   rE   re   rn   rf   rE   rg   r   r<   rF   r=   r   r   r   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r   )&rj   rZ   ra   rk   r:   rD   r   r   r;   rE   rd   rE   re   rn   rf   rE   rg   r   r<   rF   r=   r   rh   r   r   r   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   r+   r   r   r1   r1   r1   r2   r)     r   c                   @     e Zd ZdddZdS )	r,   imagesr(   r+   Nonec                 C  4   || _ t|j| _t|j| _t|j| _d S N)_imagesr
   to_raw_response_wrapperr_   ru   r   r0   r   r1   r1   r2   __init__     
zImagesWithRawResponse.__init__Nr   r(   r+   r   r   r   r   r   r1   r1   r1   r2   r,         r,   c                   @  r   )	r   r   r)   r+   r   c                 C  r   r   )r   r
   async_to_raw_response_wrapperr_   ru   r   r   r1   r1   r2   r   %  r   z#AsyncImagesWithRawResponse.__init__Nr   r)   r+   r   r   r1   r1   r1   r2   r   $  r   r   c                   @  r   )	r5   r   r(   r+   r   c                 C  .   || _ t|j| _t|j| _t|j| _d S r   )r   r   r_   ru   r   r   r1   r1   r2   r   4     
z$ImagesWithStreamingResponse.__init__Nr   r   r1   r1   r1   r2   r5   3  r   r5   c                   @  r   )	r   r   r)   r+   r   c                 C  r   r   )r   r    r_   ru   r   r   r1   r1   r2   r   C  r   z)AsyncImagesWithStreamingResponse.__init__Nr   r   r1   r1   r1   r2   r   B  r   r   )=
__future__r   typingr   r   r   r   typing_extensionsr   r   httpx r
   typesr   r   r   _typesr   r   r   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   r5   r   r1   r1   r1   r2   <module>   sL   ,              