
    -2i}                       d dl mZ d dl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mZ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 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)m*Z*m+Z+m,Z,m-Z- ddl.m/Z/m0Z0 ddl1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7 ddl8mZ ddl9m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          ZA G d d          ZB G d d           ZCdS )!    )annotations)TYPE_CHECKINGMappingcast)Literalassert_neverN   )_legacy_response)	VideoSize
VideoModelVideoSecondsvideo_list_paramsvideo_remix_paramsvideo_create_paramsvideo_download_content_params)BodyOmitQueryHeadersNotGiven	FileTypesomit	not_given)extract_filesmaybe_transformdeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)StreamedBinaryAPIResponseAsyncStreamedBinaryAPIResponseto_streamed_response_wrapper"async_to_streamed_response_wrapper#to_custom_streamed_response_wrapper)async_to_custom_streamed_response_wrapper)SyncConversationCursorPageAsyncConversationCursorPage)Video)AsyncPaginatormake_request_options)is_given)r   )r   )r   )VideoDeleteResponseVideosAsyncVideosc            
          e Zd Zed5d            Zed6d            Zeeeedddedd7dZeeeeeddded	d8dZ	ed d9d"Z
ddded#d:d$Zeeeddded%d;d,Zddded#d<d.Zeddded/d=d3Zddded#d>d4ZdS )?r.   returnVideosWithRawResponsec                     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
        )r2   selfs    V/var/www/html/pixcura-vrs/venv/lib/python3.11/site-packages/openai/resources/videos.pywith_raw_responsezVideos.with_raw_response-   s     %T***    VideosWithStreamingResponsec                     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:   r5   s    r7   with_streaming_responsezVideos.with_streaming_response7   s     +4000r9   Ninput_referencemodelsecondssizeextra_headersextra_query
extra_bodytimeoutpromptstrr?   FileTypes | Omitr@   VideoModel | OmitrA   VideoSeconds | OmitrB   VideoSize | OmitrC   Headers | NonerD   Query | NonerE   Body | NonerF   'float | httpx.Timeout | None | NotGivenr)   c       	        @   t          |||||d          }
t          t          t          t          t
          f         |
          dgg          }|rddi|pi }|                     dt          |
t          j	                  |t          ||||	          t                    S )	Q  
        Create a video

        Args:
          prompt: Text prompt that describes the video to generate.

          input_reference: Optional image reference that guides generation.

          model: The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
              to `sora-2`.

          seconds: Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.

          size: Output resolution formatted as width x height (allowed values: 720x1280,
              1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.

          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
        rG   r?   r@   rA   rB   r?   pathsContent-Typemultipart/form-data/videosrC   rD   rE   rF   bodyfilesoptionscast_to)r   r   r   r   rH   object_postr   r   VideoCreateParamsr+   r)   r6   rG   r?   r@   rA   rB   rC   rD   rE   rF   r[   r\   s               r7   createzVideos.create@   s    N   #2" 
 
 d73;#7>>HYGZF[\\\ 	] ,-B\}GZXZ\Mzz ':'LMM(+Q[el     
 
 	
r9   	r?   r@   rA   rB   poll_interval_msrC   rD   rE   rF   re   
int | Omitc       
        v    |                      ||||||||	|
	  	        }|                     |j        |          S )/Create a video and wait for it to be processed.	r@   rG   r?   rA   rB   rC   rD   rE   rF   re   rc   pollidr6   rG   r?   r@   rA   rB   re   rC   rD   rE   rF   videos               r7   create_and_pollzVideos.create_and_poll   s\    " +'#!  

 

 yyH-  
 
 	
r9   rj   video_idc                  ddi}t          |          rt          |          |d<   	 | j                            ||          }|                                }|j        dk    s|j        dk    rVt          |          s.|j                            d          }|t          |          }nd
}| 	                    |d
z             n6|j        dk    s|j        dk    r|S t          rt          |j                   n|S )Wait for the vector store file to finish processing.

        Note: this will return even if the file failed to process, you need to check
        file.last_error and file.status to handle these cases
        X-Stainless-Poll-Helpertrue X-Stainless-Custom-Poll-IntervalTrC   in_progressqueuedopenai-poll-after-msN  	completedfailedr,   rH   r8   retrieveparsestatusheadersgetint_sleepr   r   r6   rq   re   r   responsero   from_headers          r7   rl   zVideos.poll   s)    $=f"E$%% 	P:=>N:O:OG67	!-66% 7  H
 NN$$E|},,0H0H 011 0"*"2"6"67M"N"NK".+.{+;+;((+/(,t34444,,0H0H  ! .... L-	!r9   rY   c          	         |st          d|          |                     d| t          ||||          t                    S )D  
        Retrieve a video

        Args:
          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
        7Expected a non-empty value for `video_id` but received /videos/rY   r]   r^   
ValueError_getr+   r)   r6   rq   rC   rD   rE   rF   s         r7   r   zVideos.retrieve   sm    .  	ecW_ccdddyy!x!!(+Q[el     
 
 	
r9   afterlimitorderrC   rD   rE   rF   r   
str | Omitr   r   Literal['asc', 'desc'] | Omit!SyncConversationCursorPage[Video]c                   |                      dt          t                   t          ||||t	          |||dt
          j                            t                    S aC  
        List videos

        Args:
          after: Identifier for the last item from the previous pagination request

          limit: Number of items to retrieve

          order: Sort order of results by timestamp. Use `asc` for ascending order or `desc` for
              descending order.

          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
        rX   )r   r   r   rC   rD   rE   rF   query)pager]   r@   )_get_api_listr'   r)   r+   r   r   VideoListParamsr6   r   r   r   rC   rD   rE   rF   s           r7   listzVideos.list   sx    @ !!+E2(+'%%!&!&!& 
 &5    # " 
 
 	
r9   r-   c          	         |st          d|          |                     d| t          ||||          t                    S )B  
        Delete a video

        Args:
          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   r   rY   r   r   _deleter+   r-   r   s         r7   deletezVideos.delete  sm    .  	ecW_ccddd||!x!!(+Q[el   (  
 
 	
r9   variantrC   rD   rE   rF   r   3Literal['video', 'thumbnail', 'spritesheet'] | Omit+_legacy_response.HttpxBinaryResponseContentc                   |st          d|          ddi|pi }|                     d| dt          ||||t          d|it          j                            t          j                  S )	  Download video content

        Args:
          variant: Which downloadable asset to return.

        Defaults to the MP4 video.

          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   Acceptapplication/binaryr   /contentr   r   r   )r   r   r+   r   r   VideoDownloadContentParamsr
   HttpxBinaryResponseContentr6   rq   r   rC   rD   rE   rF   s          r7   download_contentzVideos.download_content?  s    6  	ecW_ccddd!#7QM<ORQyy)x)))(+'%%y'&:<Y<tuu   %?  

 

 
	
r9   c          
         |st          d|          |                     d| dt          d|it          j                  t          ||||          t                    S )  
        Create a video remix

        Args:
          prompt: Updated text prompt that directs the remix generation.

          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   r   /remixrG   rY   r[   r]   r^   )r   r`   r   r   VideoRemixParamsr+   r)   r6   rq   rG   rC   rD   rE   rF   s          r7   remixzVideos.remixi  s    4  	ecW_ccdddzz'x''' (F!35G5XYY(+Q[el     
 
 	
r9   )r1   r2   )r1   r:   rG   rH   r?   rI   r@   rJ   rA   rK   rB   rL   rC   rM   rD   rN   rE   rO   rF   rP   r1   r)   rG   rH   r?   rI   r@   rJ   rA   rK   rB   rL   re   rf   rC   rM   rD   rN   rE   rO   rF   rP   r1   r)   rq   rH   re   rf   r1   r)   rq   rH   rC   rM   rD   rN   rE   rO   rF   rP   r1   r)   )r   r   r   rf   r   r   rC   rM   rD   rN   rE   rO   rF   rP   r1   r   rq   rH   rC   rM   rD   rN   rE   rO   rF   rP   r1   r-   rq   rH   r   r   rC   rM   rD   rN   rE   rO   rF   rP   r1   r   rq   rH   rG   rH   rC   rM   rD   rN   rE   rO   rF   rP   r1   r)   __name__
__module____qualname__r   r8   r=   r   r   rc   rp   rl   r   r   r   r   r    r9   r7   r.   r.   ,   s       + + + _+ 1 1 1 _1 -1#''+!% )-$("&;D>
 >
 >
 >
 >
 >
H -1#''+!%'+ )-$("&;D 
  
  
  
  
  
L (,	%! %! %! %! %! %!Z )-$("&;D
 
 
 
 
 
H ! /3 )-$("&;D2
 2
 2
 2
 2
 2
t )-$("&;D
 
 
 
 
 
J HL )-$("&;D(
 (
 (
 (
 (
 (
b )-$("&;D#
 #
 #
 #
 #
 #
 #
 #
r9   c            
          e Zd Zed5d            Zed6d            Zeeeedddedd7dZeeeeeddded	d8dZ	ed d9d"Z
ddded#d:d$Zeeeddded%d;d,Zddded#d<d.Zeddded/d=d3Zddded#d>d4ZdS )?r/   r1   AsyncVideosWithRawResponsec                     t          |           S r4   )r   r5   s    r7   r8   zAsyncVideos.with_raw_response  s     *$///r9    AsyncVideosWithStreamingResponsec                     t          |           S r<   )r   r5   s    r7   r=   z#AsyncVideos.with_streaming_response  s     0555r9   Nr>   rG   rH   r?   rI   r@   rJ   rA   rK   rB   rL   rC   rM   rD   rN   rE   rO   rF   rP   r)   c       	        \  K   t          |||||d          }
t          t          t          t          t
          f         |
          dgg          }|rddi|pi }|                     dt          |
t          j	                   d{V |t          ||||	          t          	           d{V S )
rR   rS   r?   rT   rV   rW   rX   NrY   rZ   )r   r   r   r   rH   r_   r`   r   r   ra   r+   r)   rb   s               r7   rc   zAsyncVideos.create  s     N   #2" 
 
 d73;#7>>HYGZF[\\\ 	] ,-B\}GZXZ\MZZ,T3F3XYYYYYYYY(+Q[el      
 
 
 
 
 
 
 
 	
r9   rd   re   rf   c       
           K   |                      ||||||||	|
	  	         d{V }|                     |j        |           d{V S )rh   ri   Nrj   rk   rn   s               r7   rp   zAsyncVideos.create_and_poll  s      " kk+'#! " 

 

 

 

 

 

 

 

 YYH-  
 
 
 
 
 
 
 
 	
r9   rj   rq   c                 K   ddi}t          |          rt          |          |d<   	 | j                            ||           d{V }|                                }|j        dk    s|j        dk    r\t          |          s.|j                            d	          }|t          |          }nd
}| 	                    |d
z             d{V  n6|j        dk    s|j        dk    r|S t          rt          |j                   n|S )rs   rt   ru   rv   Trw   Nrx   ry   rz   r{   r|   r}   r~   r   s          r7   rl   zAsyncVideos.poll  s]      $=f"E$%% 	P:=>N:O:OG67	!!3<<% =        H
 NN$$E|},,0H0H 011 0"*"2"6"67M"N"NK".+.{+;+;((+/(kk"2T"9::::::::::,,0H0H  ! .... L-	!r9   rY   c          	        K   |st          d|          |                     d| t          ||||          t                     d{V S )r   r   r   rY   r   Nr   r   s         r7   r   zAsyncVideos.retrieve,  s      .  	ecW_ccdddYY!x!!(+Q[el     
 
 
 
 
 
 
 
 	
r9   r   r   r   r   r   r   9AsyncPaginator[Video, AsyncConversationCursorPage[Video]]c                   |                      dt          t                   t          ||||t	          |||dt
          j                            t                    S r   )r   r(   r)   r+   r   r   r   r   s           r7   r   zAsyncVideos.listM  sx    @ !!,U3(+'%%!&!&!& 
 &5    # " 
 
 	
r9   r-   c          	        K   |st          d|          |                     d| t          ||||          t                     d{V S )r   r   r   rY   r   Nr   r   s         r7   r   zAsyncVideos.delete  s      .  	ecW_ccddd\\!x!!(+Q[el   ( " 
 
 
 
 
 
 
 
 	
r9   r   r   r   r   c                  K   |st          d|          ddi|pi }|                     d| dt          ||||t          d|it          j                   d{V           t          j        	           d{V S )
r   r   r   r   r   r   r   Nr   r   )r   r   r+   r   r   r   r
   r   r   s          r7   r   zAsyncVideos.download_content  s      6  	ecW_ccddd!#7QM<ORQYY)x)))(+'%1(*G*b          %?  
 
 
 
 
 
 
 
 	
r9   c          
        K   |st          d|          |                     d| dt          d|it          j                   d{V t          ||||          t                     d{V S )r   r   r   r   rG   NrY   r   )r   r`   r   r   r   r+   r)   r   s          r7   r   zAsyncVideos.remix  s      4  	ecW_ccdddZZ'x''',h-?ASAdeeeeeeee(+Q[el      
 
 
 
 
 
 
 
 	
r9   )r1   r   )r1   r   r   r   r   r   )r   r   r   rf   r   r   rC   rM   rD   rN   rE   rO   rF   rP   r1   r   r   r   r   r   r   r9   r7   r/   r/     s       0 0 0 _0 6 6 6 _6 -1#''+!% )-$("&;D>
 >
 >
 >
 >
 >
H -1#''+!%'+ )-$("&;D 
  
  
  
  
  
L (,	%! %! %! %! %! %!Z )-$("&;D
 
 
 
 
 
H ! /3 )-$("&;D2
 2
 2
 2
 2
 2
t )-$("&;D
 
 
 
 
 
J HL )-$("&;D*
 *
 *
 *
 *
 *
f )-$("&;D#
 #
 #
 #
 #
 #
 #
 #
r9   c                      e Zd ZddZdS )r2   videosr.   r1   Nonec                |   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S N)	_videosr
   to_raw_response_wrapperrc   r   r   r   r   r   r6   r   s     r7   __init__zVideosWithRawResponse.__init__  s    &>M
 
 )@O
 
 %<K
 
	 '>M
 
 !1 H#!
 !
 &=L
 



r9   Nr   r.   r1   r   r   r   r   r   r   r9   r7   r2   r2     (        
 
 
 
 
 
r9   r2   c                      e Zd ZddZdS )r   r   r/   r1   r   c                |   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r   )	r   r
   async_to_raw_response_wrapperrc   r   r   r   r   r   r   s     r7   r   z#AsyncVideosWithRawResponse.__init__  s    &DM
 
 )FO
 
 %BK
 
	 'DM
 
 !1 N#!
 !
 &CL
 



r9   Nr   r/   r1   r   r   r   r9   r7   r   r     r   r9   r   c                      e Zd ZddZdS )r:   r   r.   r1   r   c                L   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j        t                    | _        t          |j	                  | _	        d S r   )
r   r#   rc   r   r   r   r%   r   r!   r   r   s     r7   r   z$VideosWithStreamingResponse.__init__%  s    2M
 
 5O
 
 1K
 
	 3M
 
 !D#%!
 !
 2L
 



r9   Nr   r   r   r9   r7   r:   r:   $  (        
 
 
 
 
 
r9   r:   c                      e Zd ZddZdS )r   r   r/   r1   r   c                L   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j        t                    | _        t          |j	                  | _	        d S r   )
r   r$   rc   r   r   r   r&   r   r"   r   r   s     r7   r   z)AsyncVideosWithStreamingResponse.__init__>  s    8M
 
 ;O
 
 7K
 
	 9M
 
 !J#*!
 !
 8L
 



r9   Nr   r   r   r9   r7   r   r   =  r   r9   r   )D
__future__r   typingr   r   r   typing_extensionsr   r   httpx r
   typesr   r   r   r   r   r   r   _typesr   r   r   r   r   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer   r    	_responser!   r"   r#   r$   r%   r&   
paginationr'   r(   types.videor)   _base_clientr*   r+   _utils._utilsr,   types.video_sizetypes.video_modeltypes.video_secondstypes.video_delete_responser-   __all__r.   r/   r2   r   r:   r   r   r9   r7   <module>r      s[   # " " " " " / / / / / / / / / / 3 3 3 3 3 3 3 3                         V U U U U U U U U U U U U U U U U U U U \ \ \ \ \ \ \ \ \ \ \ \ % % % % % % 9 9 9 9 9 9 9 9                Q P P P P P P P       ? ? ? ? ? ? ? ? $ $ $ $ $ $ ( ( ( ( ( ( * * * * * * . . . . . . = = = = = =]
#`
 `
 `
 `
 `
_ `
 `
 `
Fb
 b
 b
 b
 b
" b
 b
 b
J
 
 
 
 
 
 
 
0
 
 
 
 
 
 
 
0
 
 
 
 
 
 
 
2
 
 
 
 
 
 
 
 
 
r9   