§
    ÒÁ³gd  ã                  óŽ  — d dl mZ d dlmZmZmZmZ d dl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 dd	l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% ddl&m'Z' ddl(m)Z) ddgZ* G d„ de¦  «        Z+ G d„ de ¦  «        Z, G d„ d¦  «        Z- G d„ d¦  «        Z. G d„ d¦  «        Z/ G d„ d¦  «        Z0dS )é    )Úannotations)ÚUnionÚMappingÚOptionalÚcast)ÚLiteralNé   )Ú_legacy_response)Úimage_edit_paramsÚimage_generate_paramsÚimage_create_variation_params)Ú	NOT_GIVENÚBodyÚQueryÚHeadersÚNotGivenÚ	FileTypes)Úextract_filesÚmaybe_transformÚdeepcopy_minimalÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)Úmake_request_options)Ú
ImageModel)ÚImagesResponseÚImagesÚAsyncImagesc                  óž   — e Zd Zed+d„¦   «         Zed,d„¦   «         Zeeeeedddedœ	d-d„Zeeeeeedddedœ
d.d#„Zeeeeeeeddded$œd/d*„Z	dS )0r    Ú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    úU/var/www/html/mpstechhub/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
        )r,   r'   s    r)   Úwith_streaming_responsezImages.with_streaming_response(   s   € õ +¨4Ñ0Ô0Ð0r+   N©	ÚmodelÚnÚresponse_formatÚsizeÚuserÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚimager   r1   ú'Union[str, ImageModel, None] | NotGivenr2   úOptional[int] | NotGivenr3   ú/Optional[Literal['url', 'b64_json']] | NotGivenr4   ú?Optional[Literal['256x256', '512x512', '1024x1024']] | NotGivenr5   ústr | NotGivenr6   úHeaders | Noner7   úQuery | Noner8   úBody | Noner9   ú'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.

        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. For `dall-e-3`, only
              `n=1` is supported.

          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
        ©r:   r1   r2   r3   r4   r5   r:   ©ÚpathsúContent-Typeúmultipart/form-dataú/images/variations©r6   r7   r8   r9   ©ÚbodyÚfilesÚoptionsÚcast_to)r   r   r   r   ÚstrÚobjectÚ_postr   r   ÚImageCreateVariationParamsr   r   ©r(   r:   r1   r2   r3   r4   r5   r6   r7   r8   r9   rN   rO   s                r)   Úcreate_variationzImages.create_variation1   sÇ   € õ`  àØØØ#2ØØðð ñ	
ô 	
ˆõ �d¥7­3µ¨;Ô#7¸Ñ>Ô>ÈÀyÀkÐRÑRÔRˆð (Ð)>ÐXÀ=ÐCVÐTVÐXˆØ�zŠzØ Ý  Õ'DÔ'_Ñ`Ô`ØÝ(Ø+¸ÐQ[Ðelðñ ô õ #ð ñ 
ô 
ð 	
r+   ©
Úmaskr1   r2   r3   r4   r5   r6   r7   r8   r9   ÚpromptrR   rY   úFileTypes | NotGivenc               óF  — t          ||||||||dœ¦  «        }t          t          t          t          t
          f         |¦  «        dgdgg¬¦  «        }ddi|	pi ¥}	|                      dt          |t          j	        ¦  «        |t          |	|
||¬¦  «        t          ¬	¦  «        S )
á›  
        Creates an edited or extended image given an original image and a prompt.

        Args:
          image: The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask
              is not provided, image must have transparency, which will be used as the mask.

          prompt: A text description of the desired image(s). The maximum length is 1000
              characters.

          mask: An additional image whose fully transparent areas (e.g. where alpha is zero)
              indicate where `image` should be edited. 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` 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
        ©r:   rZ   rY   r1   r2   r3   r4   r5   r:   rY   rG   rI   rJ   ú/images/editsrL   rM   )r   r   r   r   rR   rS   rT   r   r   ÚImageEditParamsr   r   ©r(   r:   rZ   rY   r1   r2   r3   r4   r5   r6   r7   r8   r9   rN   rO   s                  r)   ÚeditzImages.editz   sÔ   € õp  àØ ØØØØ#2ØØð	ð 	ñ
ô 
ˆõ �d¥7­3µ¨;Ô#7¸Ñ>Ô>ÈÀyÐSYÐRZÐF[Ð\Ñ\Ô\ˆð (Ð)>ÐXÀ=ÐCVÐTVÐXˆØ�zŠzØÝ  Õ'8Ô'HÑIÔIØÝ(Ø+¸ÐQ[Ðelðñ ô õ #ð ñ 
ô 
ð 	
r+   ©r1   r2   Úqualityr3   r4   Ústyler5   r6   r7   r8   r9   rd   ú$Literal['standard', 'hd'] | NotGivenúYOptional[Literal['256x256', '512x512', '1024x1024', '1792x1024', '1024x1792']] | NotGivenre   ú0Optional[Literal['vivid', 'natural']] | NotGivenc               ó¢   — |                       dt          ||||||||dœt          j        ¦  «        t	          |	|
||¬¦  «        t
          ¬¦  «        S )áŽ  
        Creates an image given a prompt.

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

          model: The model to use for image generation.

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

          quality: The quality of the image that will be generated. `hd` creates images with finer
              details and greater consistency across the image. This param is only supported
              for `dall-e-3`.

          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` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or
              `1024x1792` for `dall-e-3` models.

          style: The style of the generated images. 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. This param is only supported for `dall-e-3`.

          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
        ú/images/generations©rZ   r1   r2   rd   r3   r4   re   r5   rL   ©rN   rP   rQ   )rT   r   r   ÚImageGenerateParamsr   r   ©r(   rZ   r1   r2   rd   r3   r4   re   r5   r6   r7   r8   r9   s                r)   ÚgeneratezImages.generateÍ   s~   € ðv �zŠzØ!Ý à$Ø"ØØ&Ø'6Ø Ø"Ø ð	ð 	õ &Ô9ñô õ )Ø+¸ÐQ[Ðelðñ ô õ #ð% ñ 
ô 
ð 	
r+   )r#   r$   )r#   r,   ©r:   r   r1   r;   r2   r<   r3   r=   r4   r>   r5   r?   r6   r@   r7   rA   r8   rB   r9   rC   r#   r   ©r:   r   rZ   rR   rY   r[   r1   r;   r2   r<   r3   r=   r4   r>   r5   r?   r6   r@   r7   rA   r8   rB   r9   rC   r#   r   ©rZ   rR   r1   r;   r2   r<   rd   rf   r3   r=   r4   rg   re   rh   r5   r?   r6   r@   r7   rA   r8   rB   r9   rC   r#   r   ©
Ú__name__Ú
__module__Ú__qualname__r   r*   r/   r   rW   rb   rp   © r+   r)   r    r       s*  € € € € € Øð+ð +ð +ñ „_ð+ð ð1ð 1ð 1ñ „_ð1ð :CØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;DðG
ð G
ð G
ð G
ð G
ð G
ð\ &/Ø9BØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;Dð!Q
ð Q
ð Q
ð Q
ð Q
ð Q
ðn :CØ&/Ø8AØKTØjsØBKØ(ð )-Ø$(Ø"&Ø;Dð!N
ð N
ð N
ð N
ð N
ð N
ð N
ð N
r+   c                  óž   — e Zd Zed+d„¦   «         Zed,d„¦   «         Zeeeeedddedœ	d-d„Zeeeeeedddedœ
d.d#„Zeeeeeeeddded$œd/d*„Z	dS )0r!   r#   ÚAsyncImagesWithRawResponsec                ó    — t          | ¦  «        S r&   )rz   r'   s    r)   r*   zAsyncImages.with_raw_response  s   € õ *¨$Ñ/Ô/Ð/r+   Ú AsyncImagesWithStreamingResponsec                ó    — t          | ¦  «        S r.   )r|   r'   s    r)   r/   z#AsyncImages.with_streaming_response)  s   € õ 0°Ñ5Ô5Ð5r+   Nr0   r:   r   r1   r;   r2   r<   r3   r=   r4   r>   r5   r?   r6   r@   r7   rA   r8   rB   r9   rC   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 )
rE   rF   r:   rG   rI   rJ   rK   NrL   rM   )r   r   r   r   rR   rS   rT   r   r   rU   r   r   rV   s                r)   rW   zAsyncImages.create_variation2  sû   è è € õ`  àØØØ#2ØØðð ñ	
ô 	
ˆõ �d¥7­3µ¨;Ô#7¸Ñ>Ô>ÈÀyÀkÐRÑRÔRˆð (Ð)>ÐXÀ=ÐCVÐTVÐXˆØ—Z’ZØ Ý,¨TÕ3PÔ3kÑlÔlÐlÐlÐlÐlÐlÐlØÝ(Ø+¸ÐQ[Ðelðñ ô õ #ð  ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r+   rX   rZ   rR   rY   r[   c             ƒ  ób  K  — t          ||||||||dœ¦  «        }t          t          t          t          t
          f         |¦  «        dgdgg¬¦  «        }ddi|	pi ¥}	|                      dt          |t          j	        ¦  «        ƒ d{V —†|t          |	|
||¬	¦  «        t          ¬
¦  «        ƒ d{V —†S )r]   r^   r:   rY   rG   rI   rJ   r_   NrL   rM   )r   r   r   r   rR   rS   rT   r   r   r`   r   r   ra   s                  r)   rb   zAsyncImages.edit{  s  è è € õp  àØ ØØØØ#2ØØð	ð 	ñ
ô 
ˆõ �d¥7­3µ¨;Ô#7¸Ñ>Ô>ÈÀyÐSYÐRZÐF[Ð\Ñ\Ô\ˆð (Ð)>ÐXÀ=ÐCVÐTVÐXˆØ—Z’ZØÝ,¨TÕ3DÔ3TÑUÔUÐUÐUÐUÐUÐUÐUØÝ(Ø+¸ÐQ[Ðelðñ ô õ #ð  ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r+   rc   rd   rf   rg   re   rh   c             ƒ  ó¾   K  — |                       dt          ||||||||dœt          j        ¦  «        ƒ d{V —†t	          |	|
||¬¦  «        t
          ¬¦  «        ƒ d{V —†S )rj   rk   rl   NrL   rm   )rT   r   r   rn   r   r   ro   s                r)   rp   zAsyncImages.generateÎ  s¾   è è € ðv —Z’ZØ!Ý,à$Ø"ØØ&Ø'6Ø Ø"Ø ð	ð 	õ &Ô9ñô ð ð ð ð ð ð õ )Ø+¸ÐQ[Ðelðñ ô õ #ð%  ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r+   )r#   rz   )r#   r|   rq   rr   rs   rt   rx   r+   r)   r!   r!     s*  € € € € € Øð0ð 0ð 0ñ „_ð0ð ð6ð 6ð 6ñ „_ð6ð :CØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;DðG
ð G
ð G
ð G
ð G
ð G
ð\ &/Ø9BØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;Dð!Q
ð Q
ð Q
ð Q
ð Q
ð Q
ðn :CØ&/Ø8AØKTØjsØBKØ(ð )-Ø$(Ø"&Ø;Dð!N
ð N
ð N
ð N
ð N
ð N
ð N
ð N
r+   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_wrapperrW   rb   rp   ©r(   r‚   s     r)   Ú__init__zImagesWithRawResponse.__init__   s^   € ØˆŒå 0Ô HØÔ#ñ!
ô !
ˆÔõ %Ô<ØŒKñ
ô 
ˆŒ	õ )Ô@ØŒOñ
ô 
ˆŒˆˆr+   N©r‚   r    r#   rƒ   ©ru   rv   rw   r‰   rx   r+   r)   r$   r$     ó(   € € € € € ð
ð 
ð 
ð 
ð 
ð 
r+   r$   c                  ó   — e Zd Zdd„ZdS )rz   r‚   r!   r#   rƒ   c                óÈ   — || _         t          j        |j        ¦  «        | _        t          j        |j        ¦  «        | _        t          j        |j        ¦  «        | _        d S r…   )r†   r
   Úasync_to_raw_response_wrapperrW   rb   rp   rˆ   s     r)   r‰   z#AsyncImagesWithRawResponse.__init__/  s^   € ØˆŒå 0Ô NØÔ#ñ!
ô !
ˆÔõ %ÔBØŒKñ
ô 
ˆŒ	õ )ÔFØŒOñ
ô 
ˆŒˆˆr+   N©r‚   r!   r#   rƒ   r‹   rx   r+   r)   rz   rz   .  rŒ   r+   rz   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   rW   rb   rp   rˆ   s     r)   r‰   z$ImagesWithStreamingResponse.__init__>  sU   € ØˆŒå <ØÔ#ñ!
ô !
ˆÔõ 1ØŒKñ
ô 
ˆŒ	õ 5ØŒOñ
ô 
ˆŒˆˆr+   NrŠ   r‹   rx   r+   r)   r,   r,   =  rŒ   r+   r,   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   rW   rb   rp   rˆ   s     r)   r‰   z)AsyncImagesWithStreamingResponse.__init__M  sU   € ØˆŒå BØÔ#ñ!
ô !
ˆÔõ 7ØŒKñ
ô 
ˆŒ	õ ;ØŒOñ
ô 
ˆŒˆˆr+   Nr�   r‹   rx   r+   r)   r|   r|   L  rŒ   r+   r|   )1Ú
__future__r   Útypingr   r   r   r   Útyping_extensionsr   ÚhttpxÚ r
   Útypesr   r   r   Ú_typesr   r   r   r   r   r   Ú_utilsr   r   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú_base_clientr   Útypes.image_modelr   Útypes.images_responser   Ú__all__r    r!   r$   rz   r,   r|   rx   r+   r)   ú<module>r¤      s‰  ðð #Ð "Ð "Ð "Ð "Ð "à 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø %Ð %Ð %Ð %Ð %Ð %à €€€à Ð Ð Ð Ð Ð Ø [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ø IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ Iðð ð ð ð ð ð ð ð ð ð ð ð &Ð %Ð %Ð %Ð %Ð %Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø XÐ XÐ XÐ XÐ XÐ XÐ XÐ XØ /Ð /Ð /Ð /Ð /Ð /Ø *Ð *Ð *Ð *Ð *Ð *Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2à�]Ð
#€ð~
ð ~
ð ~
ð ~
ð ~
ˆ_ñ ~
ô ~
ð ~
ðB~
ð ~
ð ~
ð ~
ð ~
Ð"ñ ~
ô ~
ð ~
ðB
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
r+   