Ë
    }¾jÜ`  ã                  ó\  — 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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«      Z.y)é    )Ú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)Ú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	y)r   c                ó   — t        | «      S ©N)ÚImagesWithRawResponse©Úselfs    úZ/var/www/html/candidateportal/venv/lib/python3.12/site-packages/openai/resources/images.pyÚwith_raw_responsezImages.with_raw_response   s   € ä$ TÓ*Ð*ó    c                ó   — t        | «      S r#   )ÚImagesWithStreamingResponser%   s    r'   Úwith_streaming_responsezImages.with_streaming_response#   s   € ä*¨4Ó0Ð0r)   N©	ÚmodelÚnÚresponse_formatÚsizeÚuserÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutc       
        ó  — t        ||||||dœ«      }t        t        t        t        t
        f   |«      dgg¬«      }|r
ddi|xs i ¥}| j                  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
        ©Úimager.   r/   r0   r1   r2   r:   ©ÚpathsúContent-Typeúmultipart/form-dataú/images/variations©r3   r4   r5   r6   ©ÚbodyÚfilesÚoptionsÚcast_to)r   r   r   r   ÚstrÚobjectÚ_postr   r   ÚImageCreateVariationParamsr   r   ©r&   r:   r.   r/   r0   r1   r2   r3   r4   r5   r6   rB   rC   s                r'   Úcreate_variationzImages.create_variation'   s¨   € ô`  àØØØ#2ØØñó	
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÀkÔRˆÙð ,Ð-BÐ\À}ÒGZÐXZÐ\ˆMØ�z‰zØ Ü  Ô'D×'_Ñ'_Ó`ØÜ(Ø+¸ÐQ[Ðelôô #ð ó 
ð 	
r)   ©
Úmaskr.   r/   r0   r1   r2   r3   r4   r5   r6   c               ó  — t        ||||||||dœ«      }t        t        t        t        t
        f   |«      dgdgg¬«      }|r
ddi|	xs i ¥}	| j                  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:   ÚpromptrM   r.   r/   r0   r1   r2   r:   rM   r;   r=   r>   ú/images/editsr@   rA   )r   r   r   r   rF   rG   rH   r   r   ÚImageEditParamsr   r   ©r&   r:   rQ   rM   r.   r/   r0   r1   r2   r3   r4   r5   r6   rB   rC   s                  r'   ÚeditzImages.editq   sµ   € ôp  àØ ØØØØ#2ØØñ	ó
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÐSYÐRZÐF[Ô\ˆÙð ,Ð-BÐ\À}ÒGZÐXZÐ\ˆMØ�z‰zØÜ  Ô'8×'HÑ'HÓIØÜ(Ø+¸ÐQ[Ðelôô #ð ó 
ð 	
r)   ©r.   r/   Úqualityr0   r1   Ústyler2   r3   r4   r5   r6   c               ó�   — | j                  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©rQ   r.   r/   rW   r0   r1   rX   r2   r@   ©rB   rD   rE   )rH   r   r   ÚImageGenerateParamsr   r   ©r&   rQ   r.   r/   rW   r0   r1   rX   r2   r3   r4   r5   r6   s                r'   ÚgeneratezImages.generateÅ   sh   € ðv �z‰zØ!Ü à$Ø"ØØ&Ø'6Ø Ø"Ø ñ	ô &×9Ñ9óô )Ø+¸ÐQ[Ðelôô #ð% ó 
ð 	
r)   )Úreturnr$   )ra   r+   ©r:   r   r.   ú0Union[str, Literal['dall-e-2'], None] | NotGivenr/   úOptional[int] | NotGivenr0   ú/Optional[Literal['url', 'b64_json']] | NotGivenr1   ú?Optional[Literal['256x256', '512x512', '1024x1024']] | NotGivenr2   ústr | NotGivenr3   úHeaders | Noner4   úQuery | Noner5   úBody | Noner6   ú'float | httpx.Timeout | None | NotGivenra   r   ©r:   r   rQ   rF   rM   zFileTypes | NotGivenr.   rc   r/   rd   r0   re   r1   rf   r2   rg   r3   rh   r4   ri   r5   rj   r6   rk   ra   r   ©rQ   rF   r.   z<Union[str, Literal['dall-e-2', 'dall-e-3'], None] | NotGivenr/   rd   rW   z$Literal['standard', 'hd'] | NotGivenr0   re   r1   zYOptional[Literal['256x256', '512x512', '1024x1024', '1792x1024', '1024x1792']] | NotGivenrX   z0Optional[Literal['vivid', 'natural']] | NotGivenr2   rg   r3   rh   r4   ri   r5   rj   r6   rk   ra   r   ©
Ú__name__Ú
__module__Ú__qualname__r   r(   r,   r   rK   rU   r`   © r)   r'   r   r      sG  „ Øò+ó ð+ð ò1ó ð1ð CLØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;DñH
ð ðH
ð @ð	H
ð
 $ðH
ð IðH
ð NðH
ð ðH
ð &ðH
ð "ðH
ð  ðH
ð 9ðH
ð 
óH
ð^ &/ØBKØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;Dñ!R
ð ðR
ð ð	R
ð
 #ðR
ð @ðR
ð $ðR
ð IðR
ð NðR
ð ðR
ð &ðR
ð "ðR
ð  ðR
ð  9ð!R
ð" 
ó#R
ðp OXØ&/Ø8AØKTØjsØBKØ(ð )-Ø$(Ø"&Ø;Dñ!N
ð ðN
ð Lð	N
ð
 $ðN
ð 6ðN
ð IðN
ð hðN
ð @ðN
ð ðN
ð &ðN
ð "ðN
ð  ðN
ð  9ð!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	y)r    c                ó   — t        | «      S r#   )ÚAsyncImagesWithRawResponser%   s    r'   r(   zAsyncImages.with_raw_response  s   € ä)¨$Ó/Ð/r)   c                ó   — t        | «      S r#   )Ú AsyncImagesWithStreamingResponser%   s    r'   r,   z#AsyncImages.with_streaming_response  s   € ä/°Ó5Ð5r)   Nr-   c       
      ƒ  ó@  K  — t        ||||||dœ«      }t        t        t        t        t
        f   |«      dgg¬«      }|r
ddi|xs i ¥}| j                  dt        |t        j                  «      ƒ d{  –—† |t        |||	|
¬«      t        ¬	«      ƒ d{  –—† S 7 Œ%7 Œ­w)
r8   r9   r:   r;   r=   r>   r?   Nr@   rA   )r   r   r   r   rF   rG   rH   r   r   rI   r   r   rJ   s                r'   rK   zAsyncImages.create_variation  s½   è ø€ ô`  àØØØ#2ØØñó	
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÀkÔRˆÙð ,Ð-BÐ\À}ÒGZÐXZÐ\ˆMØ—Z‘ZØ Ü,¨TÔ3P×3kÑ3kÓl×lØÜ(Ø+¸ÐQ[Ðelôô #ð  ó 
÷ 
ð 	
àløð
ús$   ‚A2BÁ4B
Á5 BÂBÂBÂBrL   c             ƒ  óH  K  — t        ||||||||dœ«      }t        t        t        t        t
        f   |«      dgdgg¬«      }|r
ddi|	xs i ¥}	| j                  dt        |t        j                  «      ƒ d{  –—† |t        |	|
||¬	«      t        ¬
«      ƒ d{  –—† S 7 Œ%7 Œ­w)rO   rP   r:   rM   r;   r=   r>   rR   Nr@   rA   )r   r   r   r   rF   rG   rH   r   r   rS   r   r   rT   s                  r'   rU   zAsyncImages.editi  sÊ   è ø€ ôp  àØ ØØØØ#2ØØñ	ó
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÐSYÐRZÐF[Ô\ˆÙð ,Ð-BÐ\À}ÒGZÐXZÐ\ˆMØ—Z‘ZØÜ,¨TÔ3D×3TÑ3TÓU×UØÜ(Ø+¸ÐQ[Ðelôô #ð  ó 
÷ 
ð 	
àUøð
ús$   ‚A6B"Á8B
Á9 B"ÂB ÂB"Â B"rV   c             ƒ  óÀ   K  — | j                  dt        ||||||||dœt        j                  «      ƒ d{  –—† t	        |	|
||¬«      t
        ¬«      ƒ d{  –—† S 7 Œ$7 Œ­w)rZ   r[   r\   Nr@   r]   )rH   r   r   r^   r   r   r_   s                r'   r`   zAsyncImages.generate½  s�   è ø€ ðv —Z‘ZØ!Ü,à$Ø"ØØ&Ø'6Ø Ø"Ø ñ	ô &×9Ñ9ó÷ ô )Ø+¸ÐQ[Ðelôô #ð%  ó 
÷ 
ð 	
ðøð
ús!   ‚3AµA
¶AÁAÁAÁA)ra   ru   )ra   rw   rb   rl   rm   rn   rr   r)   r'   r    r      sG  „ Øò0ó ð0ð ò6ó ð6ð CLØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;DñH
ð ðH
ð @ð	H
ð
 $ðH
ð IðH
ð NðH
ð ðH
ð &ðH
ð "ðH
ð  ðH
ð 9ðH
ð 
óH
ð^ &/ØBKØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;Dñ!R
ð ðR
ð ð	R
ð
 #ðR
ð @ðR
ð $ðR
ð IðR
ð NðR
ð ðR
ð &ðR
ð "ðR
ð  ðR
ð  9ð!R
ð" 
ó#R
ðp OXØ&/Ø8AØKTØjsØBKØ(ð )-Ø$(Ø"&Ø;Dñ!N
ð ðN
ð Lð	N
ð
 $ðN
ð 6ðN
ð IðN
ð hðN
ð @ðN
ð ðN
ð &ðN
ð "ðN
ð  ðN
ð  9ð!N
ð" 
ô#N
r)   c                  ó   — e Zd Zdd„Zy)r$   c                óê   — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        y r#   )Ú_imagesr
   Úto_raw_response_wrapperrK   rU   r`   ©r&   Úimagess     r'   Ú__init__zImagesWithRawResponse.__init__  s[   € ØˆŒä 0× HÑ HØ×#Ñ#ó!
ˆÔô %×<Ñ<Ø�K‰Kó
ˆŒ	ô )×@Ñ@Ø�O‰Oó
ˆ�r)   N©r€   r   ra   ÚNone©ro   rp   rq   r�   rr   r)   r'   r$   r$     ó   „ ô
r)   r$   c                  ó   — e Zd Zdd„Zy)ru   c                óê   — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        y r#   )r}   r
   Úasync_to_raw_response_wrapperrK   rU   r`   r   s     r'   r�   z#AsyncImagesWithRawResponse.__init__  s[   € ØˆŒä 0× NÑ NØ×#Ñ#ó!
ˆÔô %×BÑBØ�K‰Kó
ˆŒ	ô )×FÑFØ�O‰Oó
ˆ�r)   N©r€   r    ra   rƒ   r„   rr   r)   r'   ru   ru     r…   r)   ru   c                  ó   — e Zd Zdd„Zy)r+   c                ó®   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        y r#   )r}   r   rK   rU   r`   r   s     r'   r�   z$ImagesWithStreamingResponse.__init__-  sI   € ØˆŒä <Ø×#Ñ#ó!
ˆÔô 1Ø�K‰Kó
ˆŒ	ô 5Ø�O‰Oó
ˆ�r)   Nr‚   r„   rr   r)   r'   r+   r+   ,  r…   r)   r+   c                  ó   — e Zd Zdd„Zy)rw   c                ó®   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        y r#   )r}   r   rK   rU   r`   r   s     r'   r�   z)AsyncImagesWithStreamingResponse.__init__<  sI   € ØˆŒä BØ×#Ñ#ó!
ˆÔô 7Ø�K‰Kó
ˆŒ	ô ;Ø�O‰Oó
ˆ�r)   Nr‰   r„   rr   r)   r'   rw   rw   ;  r…   r)   rw   )/Ú
__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.images_responser   Ú__all__r   r    r$   ru   r+   rw   rr   r)   r'   ú<module>rœ      s•   ðõ #ç 1Ó 1Ý %ã å ß [Ñ [ß I× I÷ó õ &ß 9ß Xõõ 3à�]Ð
#€ôu
ˆ_ô u
ôpu
Ð"ô u
÷p
ñ 
÷
ñ 
÷
ñ 
÷
ò 
r)   