Ë
    ,Œ:jÙY  ã                  ó(  — d dl mZ d dlmZmZmZmZmZ d dlm	Z	 d dl
Z
ddlmZ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 dd	lmZmZ dd
lmZm Z  ddl!m"Z" erddl#m$Z$m%Z% ddgZ& G d„ de«      Z' G d„ de«      Z( G d„ d«      Z) G d„ d«      Z*y)é    )Úannotations)ÚTYPE_CHECKINGÚUnionÚMappingÚOptionalÚcast)ÚLiteralNé   )ÚImagesResponseÚimage_edit_paramsÚimage_generate_paramsÚimage_create_variation_params)Ú	NOT_GIVENÚBodyÚQueryÚHeadersÚNotGivenÚ	FileTypes)Úextract_filesÚmaybe_transformÚdeepcopy_minimal)ÚSyncAPIResourceÚAsyncAPIResource)Úto_raw_response_wrapperÚasync_to_raw_response_wrapper)Úmake_request_options)ÚOpenAIÚAsyncOpenAIÚImagesÚAsyncImagesc                  ó  ‡ — e Zd ZU ded<   dˆ f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ˆ xZ	S )r   ÚImagesWithRawResponseÚwith_raw_responsec                óD   •— t         ‰| �  |«       t        | «      | _        y ©N)ÚsuperÚ__init__r"   r#   ©ÚselfÚclientÚ	__class__s     €úY/var/www/html/tokenscope/api/venv/lib/python3.12/site-packages/openai/resources/images.pyr'   zImages.__init__   s   ø€ Ü‰Ñ˜Ô Ü!6°tÓ!<ˆÕó    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`.

          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/   r0   r1   r2   r3   r;   ©ÚpathsúContent-Typeúmultipart/form-dataú/images/variations©r4   r5   r6   r7   ©ÚbodyÚfilesÚoptionsÚcast_to©r   r   r   r   ÚstrÚobjectÚ_postr   r   ÚImageCreateVariationParamsr   r   ©r)   r;   r/   r0   r1   r2   r3   r4   r5   r6   r7   rC   rD   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/   r0   r1   r2   r3   r4   r5   r6   r7   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 )
áF  
        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`.

          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   r/   r0   r1   r2   r3   r;   rO   r<   r>   r?   ú/images/editsrA   rB   ©r   r   r   r   rH   rI   rJ   r   r   ÚImageEditParamsr   r   ©r)   r;   rS   rO   r/   r0   r1   r2   r3   r4   r5   r6   r7   rC   rD   s                  r,   ÚeditzImages.editm   sµ   € ôn  àØ ØØØØ#2ØØñ	ó
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÐSYÐRZÐF[Ô\ˆÙð ,Ð-BÐ\À}ÒGZÐXZÐ\ˆMà�z‰zØÜ  Ô'8×'HÑ'HÓIØÜ(Ø+¸ÐQ[Ðelôô #ð ó 
ð 	
r-   ©r/   r0   Úqualityr1   r2   Ústyler3   r4   r5   r6   r7   c               ó�   — | j                  dt        ||||||||dœt        j                  «      t	        |	|
||¬«      t
        ¬«      S )á9  
        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`.

          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   r/   r0   rZ   r1   r2   r[   r3   rA   ©rC   rE   rF   ©rJ   r   r   ÚImageGenerateParamsr   r   ©r)   rS   r/   r0   rZ   r1   r2   r[   r3   r4   r5   r6   r7   s                r,   ÚgeneratezImages.generateÁ   sh   € ðt �z‰zØ!Ü à$Ø"ØØ&Ø'6Ø Ø"Ø ñ	ô &×9Ñ9óô )Ø+¸ÐQ[Ðelôô #ð% ó 
ð 	
r-   )r*   r   ÚreturnÚNone©r;   r   r/   ú0Union[str, Literal['dall-e-2'], None] | NotGivenr0   úOptional[int] | NotGivenr1   ú/Optional[Literal['url', 'b64_json']] | NotGivenr2   ú?Optional[Literal['256x256', '512x512', '1024x1024']] | NotGivenr3   ústr | NotGivenr4   úHeaders | Noner5   úQuery | Noner6   úBody | Noner7   ú'float | httpx.Timeout | None | NotGivenre   r   ©r;   r   rS   rH   rO   zFileTypes | NotGivenr/   rh   r0   ri   r1   rj   r2   rk   r3   rl   r4   rm   r5   rn   r6   ro   r7   rp   re   r   ©rS   rH   r/   z<Union[str, Literal['dall-e-2', 'dall-e-3'], None] | NotGivenr0   ri   rZ   z$Literal['standard', 'hd'] | NotGivenr1   rj   r2   zYOptional[Literal['256x256', '512x512', '1024x1024', '1792x1024', '1024x1792']] | NotGivenr[   z0Optional[Literal['vivid', 'natural']] | NotGivenr3   rl   r4   rm   r5   rn   r6   ro   r7   rp   re   r   ©
Ú__name__Ú
__module__Ú__qualname__Ú__annotations__r'   r   rM   rX   rd   Ú__classcell__©r+   s   @r,   r   r      s-  ø… Ø,Ó,õ=ð 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ñ!M
ð ðM
ð Lð	M
ð
 $ðM
ð 6ðM
ð IðM
ð hðM
ð @ðM
ð ðM
ð &ðM
ð "ðM
ð  ðM
ð  9ð!M
ð" 
÷#M
r-   c                  ó  ‡ — e Zd ZU ded<   dˆ f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ˆ xZ	S )r    ÚAsyncImagesWithRawResponser#   c                óD   •— t         ‰| �  |«       t        | «      | _        y r%   )r&   r'   r{   r#   r(   s     €r,   r'   zAsyncImages.__init__  s   ø€ Ü‰Ñ˜Ô Ü!;¸DÓ!AˆÕr-   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                  «      |t        |||	|
¬«      t        ¬«      ƒ d	{  –—† S 7 Œ­w)
r9   r:   r;   r<   r>   r?   r@   rA   rB   NrG   rL   s                r,   rM   zAsyncImages.create_variation  s¶   è ø€ ô^  àØØØ#2ØØñó	
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÀkÔRˆÙð ,Ð-BÐ\À}ÒGZÐXZÐ\ˆMà—Z‘ZØ Ü  Ô'D×'_Ñ'_Ó`ØÜ(Ø+¸ÐQ[Ðelôô #ð  ó 
÷ 
ð 	
ð 
ús   ‚BBÂBÂBrN   c             ƒ  ó4  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                  «      |t        |	|
||¬«      t        ¬	«      ƒ d
{  –—† S 7 Œ­w)rQ   rR   r;   rO   r<   r>   r?   rT   rA   rB   NrU   rW   s                  r,   rX   zAsyncImages.editb  sÃ   è ø€ ôn  àØ ØØØØ#2ØØñ	ó
ˆô œd¤7¬3´¨;Ñ#7¸Ó>ÈÀyÐSYÐRZÐF[Ô\ˆÙð ,Ð-BÐ\À}ÒGZÐXZÐ\ˆMà—Z‘ZØÜ  Ô'8×'HÑ'HÓIØÜ(Ø+¸ÐQ[Ðelôô #ð  ó 
÷ 
ð 	
ð 
ús   ‚BBÂBÂBrY   c             ƒ  ó¬   K  — | j                  dt        ||||||||dœt        j                  «      t	        |	|
||¬«      t
        ¬«      ƒ d{  –—† S 7 Œ­w)r]   r^   r_   rA   r`   Nra   rc   s                r,   rd   zAsyncImages.generate¶  sv   è ø€ ðt —Z‘ZØ!Ü à$Ø"ØØ&Ø'6Ø Ø"Ø ñ	ô &×9Ñ9óô )Ø+¸ÐQ[Ðelôô #ð%  ó 
÷ 
ð 	
ð 
ús   ‚AAÁAÁA)r*   r   re   rf   rg   rq   rr   rs   ry   s   @r,   r    r      s.  ø… Ø1Ó1õBð 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ñ!M
ð ðM
ð Lð	M
ð
 $ðM
ð 6ðM
ð IðM
ð hðM
ð @ðM
ð ðM
ð &ðM
ð "ðM
ð  ðM
ð  9ð!M
ð" 
÷#M
r-   c                  ó   — e Zd Zdd„Zy)r"   c                ó    — t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        y r%   )r   rM   rX   rd   ©r)   Úimagess     r,   r'   zImagesWithRawResponse.__init__  sB   € Ü 7Ø×#Ñ#ó!
ˆÔô ,Ø�K‰Kó
ˆŒ	ô 0Ø�O‰Oó
ˆ�r-   N)rƒ   r   re   rf   ©rt   ru   rv   r'   © r-   r,   r"   r"     ó   „ ô	
r-   r"   c                  ó   — e Zd Zdd„Zy)r{   c                ó    — t        |j                  «      | _        t        |j                  «      | _        t        |j                  «      | _        y r%   )r   rM   rX   rd   r‚   s     r,   r'   z#AsyncImagesWithRawResponse.__init__  sB   € Ü =Ø×#Ñ#ó!
ˆÔô 2Ø�K‰Kó
ˆŒ	ô 6Ø�O‰Oó
ˆ�r-   N)rƒ   r    re   rf   r„   r…   r-   r,   r{   r{     r†   r-   r{   )+Ú
__future__r   Útypingr   r   r   r   r   Útyping_extensionsr	   ÚhttpxÚtypesr   r   r   r   Ú_typesr   r   r   r   r   r   Ú_utilsr   r   r   Ú	_resourcer   r   Ú	_responser   r   Ú_base_clientr   Ú_clientr   r   Ú__all__r   r    r"   r{   r…   r-   r,   ú<module>r•      s{   ðõ #ç @Õ @Ý %ã ÷ó ÷ J× Iß EÑ Eß 9ß NÝ /áß-à�]Ð
#€ôr
ˆ_ô r
ôjr
Ð"ô r
÷j

ñ 

÷

ò 

r-   