
    Oj\m                    \   d dl 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mZ ddl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m Z 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      Z/y)    )annotationsN   )_legacy_response)BodyOmitQueryHeadersNoneTypeNotGivenomit	not_given)path_templatemaybe_transform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)session_fork_paramssession_refer_paramssession_accept_paramssession_reject_params)make_request_options)SessionForkResponse)MediaSessionForkConfigParamSessionsAsyncSessionsc                  B   e Zd Zedd       Zedd       Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 ddZe	ddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
ddded	 	 	 	 	 	 	 	 	 	 	 dd	Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Z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 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
        )SessionsWithRawResponseselfs    u/var/www/origus_pro_usr/data/www/origus.pro/core/.venv/lib/python3.12/site-packages/openai/resources/live/sessions.pywith_raw_responsezSessions.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
        )SessionsWithStreamingResponser'   s    r)   with_streaming_responsez Sessions.with_streaming_response,   s     -T22r+   Nextra_headersextra_query
extra_bodytimeoutc                   |st        d|      ddi|xs i }| j                  t        d|      t        d|it        j
                        t        ||||ddi	      t        
      S )&  Accept an incoming SIP call.

        Supply session with type live, the model, and
        startup configuration. Before accepting calls, follow the
        [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting)
        to write frontend conversation instructions and a separate backend prompt. SIP
        media format is negotiated; omit audio.format.

        Args:
          session: Model and startup configuration for the Live session that answers the incoming
              SIP call.

          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
        9Expected a non-empty value for `session_id` but received Accept*/*"/live/sessions/{session_id}/accept
session_idsessionbearer_authTr1   r2   r3   r4   securitybodyoptionscast_to)
ValueError_postr   r   r   SessionAcceptParamsr   r
   r(   r<   r=   r1   r2   r3   r4   s          r)   acceptzSessions.accept5   s    @ XYcXfghh!5B]-@bBzz>:V )W!57L7`7`a(+'%'.   
 	
r+   c                   |st        d|      ddi|xs i }| j                  t        d|      t        ||||ddi      t        j
                  	      S )
  
        Get Live session content

        Args:
          session_id: The ID of the stored Live session to download. Use the session ID returned when
              the session started with storage enabled.

          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
        r7   r8   application/binary#/live/sessions/{session_id}/contentr;   r>   Tr?   rC   rD   rE   _getr   r   r   HttpxBinaryResponseContentr(   r<   r1   r2   r3   r4   s         r)   download_recordingzSessions.download_recordinge   sy    4 XYcXfghh!#7QM<ORQyy?JW(+'%'. %??  

 
	
r+   r=   r1   r2   r3   r4   c                   |st        d|      | j                  t        d|      t        ||dt        j
                        t        ||||ddi      t              S )	  
        Fork a stored Live session onto a new WebRTC connection.

        Args:
          transport: WebRTC transport with an SDP offer for the new connection to the forked session.

          session: Optional configuration overrides for the new Live session. Omit this object or
              send an empty object to inherit the stored session's settings.

          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
        r7    /live/sessions/{session_id}/forkr;   	transportr=   r>   Tr?   rA   )rE   rF   r   r   r   SessionForkParamsr   r   r(   r<   rY   r=   r1   r2   r3   r4   s           r)   forkzSessions.fork   s~    < XYcXfghhzz<T !*& $55 )+'%'. (!  
 	
r+   c                   |st        d|      ddi|xs i }| j                  t        d|      t        ||||ddi      t        	      S )
\  
        End a SIP call identified by session_id.

        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
        r7   r8   r9   "/live/sessions/{session_id}/hangupr;   r>   Tr?   rN   rE   rF   r   r   r
   rR   s         r)   hangupzSessions.hangup   sr    . XYcXfghh!5B]-@bBzz>:V(+'%'.   

 
	
r+   c                   |st        d|      ddi|xs i }| j                  t        d|      t        d|it        j
                        t        ||||ddi	      t        
      S )#  Transfer a SIP call to another destination.

        Supply a nonblank target_uri for the
        SIP Refer-To header.

        Args:
          target_uri: Nonblank URI for the SIP Refer-To header, such as tel:+14155550123 or
              sip:agent@example.com.

          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
        r7   r8   r9   !/live/sessions/{session_id}/referr;   
target_urir>   Tr?   rA   )rE   rF   r   r   r   SessionReferParamsr   r
   r(   r<   re   r1   r2   r3   r4   s          r)   referzSessions.refer   s    : XYcXfghh!5B]-@bBzz=*U ,
!;=Q=d=de(+'%'.   
 	
r+   c                   |st        d|      ddi|xs i }| j                  t        d|      t        d|it        j
                        t        ||||ddi	      t        
      S )  Reject an incoming SIP call.

        Send a required SIP rejection status_code between
        300 and 699.

        Args:
          status_code: SIP rejection status sent to the caller. This field is required.

          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
        r7   r8   r9   "/live/sessions/{session_id}/rejectr;   status_coder>   Tr?   rA   )rE   rF   r   r   r   SessionRejectParamsr   r
   r(   r<   rl   r1   r2   r3   r4   s          r)   rejectzSessions.reject  s    8 XYcXfghh!5B]-@bBzz>:V -!=?T?h?hi(+'%'.   
 	
r+   )returnr&   )rp   r.   r<   strr=   zsession_accept_params.Sessionr1   Headers | Noner2   Query | Noner3   Body | Noner4   (float | httpx2.Timeout | None | NotGivenrp   Noner<   rr   r1   rs   r2   rt   r3   ru   r4   rv   rp   z+_legacy_response.HttpxBinaryResponseContentr<   rr   rY   zsession_fork_params.Transportr=   z"MediaSessionForkConfigParam | Omitr1   rs   r2   rt   r3   ru   r4   rv   rp   r   r<   rr   r1   rs   r2   rt   r3   ru   r4   rv   rp   rw   r<   rr   re   rr   r1   rs   r2   rt   r3   ru   r4   rv   rp   rw   r<   rr   rl   intr1   rs   r2   rt   r3   ru   r4   rv   rp   rw   __name__
__module____qualname__r   r*   r/   r   rI   rS   r   r\   ra   rh   ro    r+   r)   r!   r!   !   s2   - - 3 3 )-$("&<E.
.
 /	.
 &.
 ".
  .
 :.
 
.
l )-$("&<E'
'
 &'
 "'
  '
 :'
 
5'
\ 7; )-$("&<E1
1
 1	1

 41
 &1
 "1
  1
 :1
 
1
r )-$("&<E$
$
 &$
 "$
  $
 :$
 
$
Z )-$("&<E+
+
 	+
 &+
 "+
  +
 :+
 
+
h )-$("&<E*
*
 	*
 &*
 "*
  *
 :*
 
*
r+   c                  B   e Zd Zedd       Zedd       Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 ddZe	ddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
ddded	 	 	 	 	 	 	 	 	 	 	 dd	Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r"   c                    t        |       S r%   )AsyncSessionsWithRawResponser'   s    r)   r*   zAsyncSessions.with_raw_responseB  s     ,D11r+   c                    t        |       S r-   )"AsyncSessionsWithStreamingResponser'   s    r)   r/   z%AsyncSessions.with_streaming_responseL  s     2$77r+   Nr0   c                 K   |st        d|      ddi|xs i }| j                  t        d|      t        d|it        j
                         d{   t        ||||dd	i
      t               d{   S 7 '7 w)r6   r7   r8   r9   r:   r;   r=   Nr>   Tr?   rA   )rE   rF   r   r   r   rG   r   r
   rH   s          r)   rI   zAsyncSessions.acceptU  s     @ XYcXfghh!5B]-@bBZZ>:V,i-ACXClClmm(+'%'.    
 
 	
m
$   AA?A;
"A?6A=7A?=A?c                  K   |st        d|      ddi|xs i }| j                  t        d|      t        ||||ddi      t        j
                  	       d
{   S 7 w)rK   r7   r8   rL   rM   r;   r>   Tr?   rN   NrO   rR   s         r)   rS   z AsyncSessions.download_recording  s     4 XYcXfghh!#7QM<ORQYY?JW(+'%'. %??  

 

 
	
 

s   AA$A"A$rT   c                  K   |st        d|      | j                  t        d|      t        ||dt        j
                         d{   t        ||||ddi      t        	       d{   S 7 '7 w)
rV   r7   rW   r;   rX   Nr>   Tr?   rA   )rE   rF   r   r   r   rZ   r   r   r[   s           r)   r\   zAsyncSessions.fork  s     < XYcXfghhZZ<T,!*& $55  )+'%'. (!   
 
 	

s$   AA6
A2
"A6-A4.A64A6c                  K   |st        d|      ddi|xs i }| j                  t        d|      t        ||||ddi      t        	       d
{   S 7 w)r^   r7   r8   r9   r_   r;   r>   Tr?   rN   Nr`   rR   s         r)   ra   zAsyncSessions.hangup  s     . XYcXfghh!5B]-@bBZZ>:V(+'%'.    

 

 
	
 

s   AAAAc                 K   |st        d|      ddi|xs i }| j                  t        d|      t        d|it        j
                         d{   t        ||||dd	i
      t               d{   S 7 '7 w)rc   r7   r8   r9   rd   r;   re   Nr>   Tr?   rA   )rE   rF   r   r   r   rf   r   r
   rg   s          r)   rh   zAsyncSessions.refer  s     : XYcXfghh!5B]-@bBZZ=*U,lJ-GI]IpIpqq(+'%'.    
 
 	
q
r   c                 K   |st        d|      ddi|xs i }| j                  t        d|      t        d|it        j
                         d{   t        ||||dd	i
      t               d{   S 7 '7 w)rj   r7   r8   r9   rk   r;   rl   Nr>   Tr?   rA   )rE   rF   r   r   r   rm   r   r
   rn   s          r)   ro   zAsyncSessions.reject4  s     8 XYcXfghh!5B]-@bBZZ>:V,m[-IK`KtKtuu(+'%'.    
 
 	
u
r   )rp   r   )rp   r   rq   rx   ry   rz   r{   r|   r~   r   r+   r)   r"   r"   A  s2   2 2 8 8 )-$("&<E.
.
 /	.
 &.
 ".
  .
 :.
 
.
l )-$("&<E'
'
 &'
 "'
  '
 :'
 
5'
\ 7; )-$("&<E1
1
 1	1

 41
 &1
 "1
  1
 :1
 
1
r )-$("&<E$
$
 &$
 "$
  $
 :$
 
$
Z )-$("&<E+
+
 	+
 &+
 "+
  +
 :+
 
+
h )-$("&<E*
*
 	*
 &*
 "*
  *
 :*
 
*
r+   c                      e Zd ZddZy)r&   c                   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y N)		_sessionsr   to_raw_response_wrapperrI   rS   r\   ra   rh   ro   r(   sessionss     r)   __init__z SessionsWithRawResponse.__init__b  s    !&>>OO
 #3"J"J''#
 %<<MM
	 '>>OO
 &==NN

 '>>OO
r+   Nr   r!   rp   rw   r   r   r   r   r   r+   r)   r&   r&   a      
r+   r&   c                      e Zd ZddZy)r   c                   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y r   )	r   r   async_to_raw_response_wrapperrI   rS   r\   ra   rh   ro   r   s     r)   r   z%AsyncSessionsWithRawResponse.__init__z  s    !&DDOO
 #3"P"P''#
 %BBMM
	 'DDOO
 &CCNN

 'DDOO
r+   Nr   r"   rp   rw   r   r   r+   r)   r   r   y  r   r+   r   c                      e Zd ZddZy)r.   c                T   || _         t        |j                        | _        t        |j                  t
              | _        t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j                        | _	        y r   )
r   r   rI   r   rS   r   r\   ra   rh   ro   r   s     r)   r   z&SessionsWithStreamingResponse.__init__  s    !2OO
 #F''%#
 1MM
	 3OO
 2NN

 3OO
r+   Nr   r   r   r+   r)   r.   r.         
r+   r.   c                      e Zd ZddZy)r   c                T   || _         t        |j                        | _        t        |j                  t
              | _        t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j                        | _	        y r   )
r   r   rI   r   rS   r   r\   ra   rh   ro   r   s     r)   r   z+AsyncSessionsWithStreamingResponse.__init__  s    !8OO
 #L''*#
 7MM
	 9OO
 8NN

 9OO
r+   Nr   r   r   r+   r)   r   r     r   r+   r   )0
__future__r   httpx2 r   _typesr   r   r   r	   r
   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   r   r   r   r   
types.liver   r   r   r   _base_clientr    types.live.session_fork_responser   *types.live.media_session_fork_config_paramr    __all__r!   r"   r&   r   r.   r   r   r+   r)   <module>r      s    #    U U U K K & :   1 C U
']
 ]
@	]
$ ]
@	
 
0
 
0
 
2
 
r+   