Ë
    F·j"d  ã                  óh  — 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«      Z0y)é    )Ú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	y)r    c                ó   — t        | «      S ©a  
        This property can be used as a prefix for any HTTP method call to return the
        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
        )ÚImagesWithRawResponse©Úselfs    úe/var/www/html/ai-video-generator/backend/venv/lib/python3.12/site-packages/openai/resources/images.pyÚwith_raw_responsezImages.with_raw_response   s   € ô % TÓ*Ð*ó    c                ó   — 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
        )Ú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¬«      }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
        ©Úimager0   r1   r2   r3   r4   r<   ©ÚpathsúContent-Typeúmultipart/form-dataú/images/variations©r5   r6   r7   r8   ©ÚbodyÚfilesÚoptionsÚcast_to)r   r   r   r   ÚstrÚobjectÚ_postr   r   ÚImageCreateVariationParamsr   r   ©r'   r<   r0   r1   r2   r3   r4   r5   r6   r7   r8   rD   rE   s                r(   Úcreate_variationzImages.create_variation1   s¥   € ô`  àØØØ#2ØØñó	
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÀkÔRˆð (Ð)>ÐXÀ=ÒCVÐTVÐXˆØ�z‰zØ Ü  Ô'D×'_Ñ'_Ó`ØÜ(Ø+¸ÐQ[Ðelôô #ð ó 
ð 	
r*   ©
Úmaskr0   r1   r2   r3   r4   r5   r6   r7   r8   c               ó  — t        ||||||||dœ«      }t        t        t        t        t
        f   |«      dgdgg¬«      }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<   ÚpromptrO   r0   r1   r2   r3   r4   r<   rO   r=   r?   r@   ú/images/editsrB   rC   )r   r   r   r   rH   rI   rJ   r   r   ÚImageEditParamsr   r   ©r'   r<   rS   rO   r0   r1   r2   r3   r4   r5   r6   r7   r8   rD   rE   s                  r(   ÚeditzImages.editz   s²   € ôp  àØ ØØØØ#2ØØñ	ó
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÐSYÐRZÐF[Ô\ˆð (Ð)>ÐXÀ=ÒCVÐTVÐXˆØ�z‰zØÜ  Ô'8×'HÑ'HÓIØÜ(Ø+¸ÐQ[Ðelôô #ð ó 
ð 	
r*   ©r0   r1   Úqualityr2   r3   Ústyler4   r5   r6   r7   r8   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©rS   r0   r1   rY   r2   r3   rZ   r4   rB   ©rD   rF   rG   )rJ   r   r   ÚImageGenerateParamsr   r   ©r'   rS   r0   r1   rY   r2   r3   rZ   r4   r5   r6   r7   r8   s                r(   ÚgeneratezImages.generateÍ   sh   € ðv �z‰zØ!Ü à$Ø"ØØ&Ø'6Ø Ø"Ø ñ	ô &×9Ñ9óô )Ø+¸ÐQ[Ðelôô #ð% ó 
ð 	
r*   )Úreturnr%   )rc   r-   ©r<   r   r0   ú'Union[str, ImageModel, None] | NotGivenr1   úOptional[int] | NotGivenr2   ú/Optional[Literal['url', 'b64_json']] | NotGivenr3   ú?Optional[Literal['256x256', '512x512', '1024x1024']] | NotGivenr4   ústr | NotGivenr5   úHeaders | Noner6   úQuery | Noner7   úBody | Noner8   ú'float | httpx.Timeout | None | NotGivenrc   r   ©r<   r   rS   rH   rO   zFileTypes | NotGivenr0   re   r1   rf   r2   rg   r3   rh   r4   ri   r5   rj   r6   rk   r7   rl   r8   rm   rc   r   ©rS   rH   r0   re   r1   rf   rY   z$Literal['standard', 'hd'] | NotGivenr2   rg   r3   zYOptional[Literal['256x256', '512x512', '1024x1024', '1792x1024', '1024x1792']] | NotGivenrZ   z0Optional[Literal['vivid', 'natural']] | NotGivenr4   ri   r5   rj   r6   rk   r7   rl   r8   rm   rc   r   ©
Ú__name__Ú
__module__Ú__qualname__r   r)   r.   r   rM   rW   rb   © r*   r(   r    r       sB  „ Øò+ó ð+ð ò1ó ð1ð :CØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;DñG
ð ðG
ð 7ð	G
ð
 $ðG
ð IðG
ð NðG
ð ðG
ð &ðG
ð "ðG
ð  ðG
ð 9ðG
ð 
óG
ð\ &/Ø9BØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;Dñ!Q
ð ðQ
ð ð	Q
ð
 #ðQ
ð 7ðQ
ð $ðQ
ð IðQ
ð NðQ
ð ðQ
ð &ðQ
ð "ðQ
ð  ðQ
ð  9ð!Q
ð" 
ó#Q
ðn :CØ&/Ø8AØKTØjsØBKØ(ð )-Ø$(Ø"&Ø;Dñ!N
ð ðN
ð 7ð	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   € ô 0°Ó5Ð5r*   Nr/   c       
      ƒ  ó<  K  — t        ||||||dœ«      }t        t        t        t        t
        f   |«      dgg¬«      }ddi|xs i ¥}| j                  dt        |t        j                  «      ƒ d{  –—† |t        |||	|
¬«      t        ¬	«      ƒ d{  –—† S 7 Œ%7 Œ­w)
r:   r;   r<   r=   r?   r@   rA   NrB   rC   )r   r   r   r   rH   rI   rJ   r   r   rK   r   r   rL   s                r(   rM   zAsyncImages.create_variation2  sº   è ø€ ô`  àØØØ#2ØØñó	
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÀkÔRˆð (Ð)>ÐXÀ=ÒCVÐTVÐXˆØ—Z‘ZØ Ü,¨TÔ3P×3kÑ3kÓl×lØÜ(Ø+¸ÐQ[Ðelôô #ð  ó 
÷ 
ð 	
àløð
ús$   ‚A0BÁ2B
Á3 BÂBÂBÂBrN   c             ƒ  óD  K  — t        ||||||||dœ«      }t        t        t        t        t
        f   |«      dgdgg¬«      }ddi|	xs i ¥}	| j                  dt        |t        j                  «      ƒ d{  –—† |t        |	|
||¬	«      t        ¬
«      ƒ d{  –—† S 7 Œ%7 Œ­w)rQ   rR   r<   rO   r=   r?   r@   rT   NrB   rC   )r   r   r   r   rH   rI   rJ   r   r   rU   r   r   rV   s                  r(   rW   zAsyncImages.edit{  sÇ   è ø€ ôp  àØ ØØØØ#2ØØñ	ó
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÐSYÐRZÐF[Ô\ˆð (Ð)>ÐXÀ=ÒCVÐTVÐXˆØ—Z‘ZØÜ,¨TÔ3D×3TÑ3TÓU×UØÜ(Ø+¸ÐQ[Ðelôô #ð  ó 
÷ 
ð 	
àUøð
ús$   ‚A4B Á6B
Á7 B ÂBÂB ÂB rX   c             ƒ  óÀ   K  — | j                  dt        ||||||||dœt        j                  «      ƒ d{  –—† t	        |	|
||¬«      t
        ¬«      ƒ d{  –—† S 7 Œ$7 Œ­w)r\   r]   r^   NrB   r_   )rJ   r   r   r`   r   r   ra   s                r(   rb   zAsyncImages.generateÎ  s�   è ø€ ðv —Z‘ZØ!Ü,à$Ø"ØØ&Ø'6Ø Ø"Ø ñ	ô &×9Ñ9ó÷ ô )Ø+¸ÐQ[Ðelôô #ð%  ó 
÷ 
ð 	
ðøð
ús!   ‚3AµA
¶AÁAÁAÁA)rc   rw   )rc   ry   rd   rn   ro   rp   rt   r*   r(   r!   r!     sB  „ Øò0ó ð0ð ò6ó ð6ð :CØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;DñG
ð ðG
ð 7ð	G
ð
 $ðG
ð IðG
ð NðG
ð ðG
ð &ðG
ð "ðG
ð  ðG
ð 9ðG
ð 
óG
ð\ &/Ø9BØ&/ØKTØPYØ(ð )-Ø$(Ø"&Ø;Dñ!Q
ð ðQ
ð ð	Q
ð
 #ðQ
ð 7ðQ
ð $ðQ
ð IðQ
ð NðQ
ð ðQ
ð &ðQ
ð "ðQ
ð  ðQ
ð  9ð!Q
ð" 
ó#Q
ðn :CØ&/Ø8AØKTØjsØBKØ(ð )-Ø$(Ø"&Ø;Dñ!N
ð ðN
ð 7ð	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 ©N)Ú_imagesr
   Úto_raw_response_wrapperrM   rW   rb   ©r'   Úimagess     r(   Ú__init__zImagesWithRawResponse.__init__   s[   € ØˆŒä 0× HÑ HØ×#Ñ#ó!
ˆÔô %×<Ñ<Ø�K‰Kó
ˆŒ	ô )×@Ñ@Ø�O‰Oó
ˆ�r*   N©rƒ   r    rc   ÚNone©rq   rr   rs   r„   rt   r*   r(   r%   r%     ó   „ ô
r*   r%   c                  ó   — e Zd Zdd„Zy)rw   c                óê   — || _         t        j                  |j                  «      | _        t        j                  |j                  «      | _        t        j                  |j
                  «      | _        y r   )r€   r
   Úasync_to_raw_response_wrapperrM   rW   rb   r‚   s     r(   r„   z#AsyncImagesWithRawResponse.__init__/  s[   € ØˆŒä 0× NÑ NØ×#Ñ#ó!
ˆÔô %×BÑBØ�K‰Kó
ˆŒ	ô )×FÑFØ�O‰Oó
ˆ�r*   N©rƒ   r!   rc   r†   r‡   rt   r*   r(   rw   rw   .  rˆ   r*   rw   c                  ó   — e Zd Zdd„Zy)r-   c                ó®   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        y r   )r€   r   rM   rW   rb   r‚   s     r(   r„   z$ImagesWithStreamingResponse.__init__>  sI   € ØˆŒä <Ø×#Ñ#ó!
ˆÔô 1Ø�K‰Kó
ˆŒ	ô 5Ø�O‰Oó
ˆ�r*   Nr…   r‡   rt   r*   r(   r-   r-   =  rˆ   r*   r-   c                  ó   — e Zd Zdd„Zy)ry   c                ó®   — || _         t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        y r   )r€   r   rM   rW   rb   r‚   s     r(   r„   z)AsyncImagesWithStreamingResponse.__init__M  sI   € ØˆŒä BØ×#Ñ#ó!
ˆÔô 7Ø�K‰Kó
ˆŒ	ô ;Ø�O‰Oó
ˆ�r*   NrŒ   r‡   rt   r*   r(   ry   ry   L  rˆ   r*   ry   )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%   rw   r-   ry   rt   r*   r(   ú<module>r       s”   ðõ #ç 1Ó 1Ý %ã å ß [Ñ [ß I× I÷ó õ &ß 9ß XÝ /Ý *Ý 2à�]Ð
#€ô~
ˆ_ô ~
ôB~
Ð"ô ~
÷B
ñ 
÷
ñ 
÷
ñ 
÷
ò 
r*   