ó
    ûÞ jš ã                  ó:  • % S SK Jr  S SKrS SKrS SKrS SKrS SKJr  S SKJ	r	J
r
JrJrJrJrJr  S SKJr  S SKrS SKJr  SSKJrJrJrJrJrJr  S	S
KJrJrJrJ r   S	SK!J"r"J#r#J$r$J%r%J&r&  S	SK'J(r(  S	SK)J*r*  S	SK+J,r,  S	SK-J.r.J/r/  S	SK0J1r1J2r2  S	SK3J4r4  S	SK5J6r6  SSK7J8r8J9r9J:r:J;r;J<r<J=r=  S	SK>J?r?  S	SK@JArA  S	SKBJCrCJDrDJErE  S	SKFJGrG  S	SKHJIrI  S	SKJJKrK  S	SKLJMrM  S	SKNJOrO  S	SKPJQrQ  S	SKRJSrS  \	(       a  S SKTJUrV  S SKWJUrX  S	SKYJZrZJ[r[  S S!/r\\Rº                  " \^5      r_S"\`S#'    " S$ S \.5      ra " S% S!\/5      rb " S& S'5      rc " S( S)5      rd " S* S+5      re " S, S-5      rf " S. S/5      rg " S0 S15      rh " S2 S35      ri " S4 S55      rj " S6 S75      rk " S8 S9\k5      rl " S: S;\k5      rm " S< S=\k5      rn " S> S?\k5      ro " S@ SA\k5      rp " SB SC\k5      rq " SD SE5      rr " SF SG\r5      rs " SH SI\r5      rt " SJ SK\r5      ru " SL SM\r5      rv " SN SO\r5      rw " SP SQ\r5      rxg)Ré    )ÚannotationsN)ÚTracebackType)ÚTYPE_CHECKINGÚAnyÚUnionÚCallableÚIteratorÚ	AwaitableÚcast)ÚAsyncIterator)Ú	BaseModelé   )ÚCallsÚ
AsyncCallsÚCallsWithRawResponseÚAsyncCallsWithRawResponseÚCallsWithStreamingResponseÚAsyncCallsWithStreamingResponseé   )ÚOmitÚQueryÚHeadersÚomit)Úis_azure_clientÚmaybe_transformÚstrip_not_givenÚasync_maybe_transformÚis_async_azure_client)Úcached_property)Únormalize_httpx_url)Úconstruct_type_unchecked)ÚSyncAPIResourceÚAsyncAPIResource)ÚOpenAIErrorÚWebSocketConnectionClosedError)Ú	SendQueue)Ú_merge_mappings)ÚClientSecretsÚAsyncClientSecretsÚClientSecretsWithRawResponseÚ!AsyncClientSecretsWithRawResponseÚ"ClientSecretsWithStreamingResponseÚ'AsyncClientSecretsWithStreamingResponse)ÚEventHandlerRegistry)Úsession_update_event_param)ÚReconnectingEventÚReconnectingOverridesÚis_recoverable_close)ÚWebSocketConnectionOptions)ÚRealtimeErrorEvent)ÚRealtimeClientEvent)ÚRealtimeServerEvent)ÚConversationItemParam)ÚRealtimeClientEventParam)Ú!RealtimeResponseCreateParamsParam)ÚClientConnection)ÚOpenAIÚAsyncOpenAIÚRealtimeÚAsyncRealtimezlogging.LoggerÚlogc                  ó²   • \ rS rSr\SS j5       r\SS j5       r\SS j5       r\SS j5       r\	\	0 0 0 SSSS	S
S.
                     SS jjr
Srg)r=   éE   c                ó,   • [        U R                  5      $ ©N)r(   Ú_client©Úselfs    Ú\/var/www/html/gaurav/venv/lib/python3.13/site-packages/openai/resources/realtime/realtime.pyÚclient_secretsÚRealtime.client_secretsF   s   € ä˜TŸ\™\Ó*Ð*ó    c                ó2   • SSK Jn  U" U R                  5      $ )Nr   )Ú_Calls)Úlib._realtimerL   rD   )rF   rL   s     rG   ÚcallsÚRealtime.callsJ   s   € å+á�d—l‘lÓ#Ð#rJ   c                ó   • [        U 5      $ ©zï
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
)ÚRealtimeWithRawResponserE   s    rG   Úwith_raw_responseÚRealtime.with_raw_responseP   s   € ô ' tÓ,Ð,rJ   c                ó   • [        U 5      $ ©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
)ÚRealtimeWithStreamingResponserE   s    rG   Úwith_streaming_responseÚ Realtime.with_streaming_responseZ   s   € ô -¨TÓ2Ð2rJ   Né   ç      à?ç       @é   ©
Úcall_idÚmodelÚextra_queryÚextra_headersÚwebsocket_connection_optionsÚon_reconnectingÚmax_retriesÚinitial_delayÚ	max_delayÚmax_queue_sizec       
        ó<   • [        U R                  UUUUUUU	U
UUS9$ ©aŠ  
The Realtime API enables you to build low-latency, multi-modal conversational experiences. It currently supports text and audio as both input and output, as well as function calling.

Some notable benefits of the API include:

- Native speech-to-speech: Skipping an intermediate text format means low latency and nuanced output.
- Natural, steerable voices: The models have natural inflection and can laugh, whisper, and adhere to tone direction.
- Simultaneous multimodal output: Text is useful for moderation; faster-than-realtime audio ensures stable playback.

The Realtime API is a stateful, event-based API that communicates over a WebSocket.
)Úclientra   rb   rc   rd   re   rf   rg   rh   r_   r`   )ÚRealtimeConnectionManagerrD   ©rF   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   s              rG   ÚconnectÚRealtime.connectc   s6   € ô2 )Ø—<‘<Ø#Ø'Ø)EØ+Ø#Ø'ØØ)ØØñ
ð 	
rJ   © )Úreturnr(   )rq   r   )rq   rR   )rq   rW   )r_   ú
str | Omitr`   rr   ra   r   rb   r   rc   r3   rd   úBCallable[[ReconnectingEvent], ReconnectingOverrides | None] | Nonere   Úintrf   Úfloatrg   ru   rh   rt   rq   rl   ©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   rH   rN   rS   rX   r   rn   Ú__static_attributes__rp   rJ   rG   r=   r=   E   sê   † Øó+ó ð+ð ó$ó ð$ð
 ó-ó ð-ð ó3ó ð3ð #Ø ØØ!#ØCEØ^bØØ"ØØ'ñ%
ð ð%
ð ð	%
ð
 ð%
ð ð%
ð 'Að%
ð \ð%
ð ð%
ð ð%
ð ð%
ð ð%
ð 
#÷%
ð %
rJ   c                  ó²   • \ rS rSr\SS j5       r\SS j5       r\SS j5       r\SS j5       r\	\	0 0 0 SSSS	S
S.
                     SS jjr
Srg)r>   é‹   c                ó,   • [        U R                  5      $ rC   )r)   rD   rE   s    rG   rH   ÚAsyncRealtime.client_secretsŒ   s   € ä! $§,¡,Ó/Ð/rJ   c                ó2   • SSK Jn  U" U R                  5      $ )Nr   )Ú_AsyncCalls)rM   r�   rD   )rF   r�   s     rG   rN   ÚAsyncRealtime.calls�   s   € å0á˜4Ÿ<™<Ó(Ð(rJ   c                ó   • [        U 5      $ rQ   )ÚAsyncRealtimeWithRawResponserE   s    rG   rS   ÚAsyncRealtime.with_raw_response–   s   € ô ,¨DÓ1Ð1rJ   c                ó   • [        U 5      $ rV   )Ú"AsyncRealtimeWithStreamingResponserE   s    rG   rX   Ú%AsyncRealtime.with_streaming_response    s   € ô 2°$Ó7Ð7rJ   NrZ   r[   r\   r]   r^   c       
        ó<   • [        U R                  UUUUUUU	U
UUS9$ rj   )ÚAsyncRealtimeConnectionManagerrD   rm   s              rG   rn   ÚAsyncRealtime.connect©   s6   € ô2 .Ø—<‘<Ø#Ø'Ø)EØ+Ø#Ø'ØØ)ØØñ
ð 	
rJ   rp   )rq   r)   )rq   r   )rq   r„   )rq   r‡   )r_   rr   r`   rr   ra   r   rb   r   rc   r3   rd   rs   re   rt   rf   ru   rg   ru   rh   rt   rq   rŠ   rv   rp   rJ   rG   r>   r>   ‹   sê   † Øó0ó ð0ð ó)ó ð)ð
 ó2ó ð2ð ó8ó ð8ð #Ø ØØ!#ØCEØ^bØØ"ØØ'ñ%
ð ð%
ð ð	%
ð
 ð%
ð ð%
ð 'Að%
ð \ð%
ð ð%
ð ð%
ð ð%
ð ð%
ð 
(÷%
ð %
rJ   c                  óF   • \ rS rSrSS jr\SS j5       r\S	S j5       rSrg)
rR   éÑ   c                ó   • Xl         g rC   ©Ú	_realtime©rF   Úrealtimes     rG   Ú__init__Ú RealtimeWithRawResponse.__init__Ò   ó   € Ø!�rJ   c                ó@   • [        U R                  R                  5      $ rC   )r*   r�   rH   rE   s    rG   rH   Ú&RealtimeWithRawResponse.client_secretsÕ   s   € ä+¨D¯N©N×,IÑ,IÓJÐJrJ   c                ó@   • [        U R                  R                  5      $ rC   )r   r�   rN   rE   s    rG   rN   ÚRealtimeWithRawResponse.callsÙ   s   € ä# D§N¡N×$8Ñ$8Ó9Ð9rJ   r�   N©r’   r=   rq   ÚNone)rq   r*   )rq   r   ©	rw   rx   ry   rz   r“   r   rH   rN   r{   rp   rJ   rG   rR   rR   Ñ   s1   † ô"ð óKó ðKð ó:ó ó:rJ   rR   c                  óF   • \ rS rSrSS jr\SS j5       r\S	S j5       rSrg)
r„   éÞ   c                ó   • Xl         g rC   r�   r‘   s     rG   r“   Ú%AsyncRealtimeWithRawResponse.__init__ß   r•   rJ   c                ó@   • [        U R                  R                  5      $ rC   )r+   r�   rH   rE   s    rG   rH   Ú+AsyncRealtimeWithRawResponse.client_secretsâ   s   € ä0°·±×1NÑ1NÓOÐOrJ   c                ó@   • [        U R                  R                  5      $ rC   )r   r�   rN   rE   s    rG   rN   Ú"AsyncRealtimeWithRawResponse.callsæ   s   € ä(¨¯©×)=Ñ)=Ó>Ð>rJ   r�   N©r’   r>   rq   r›   )rq   r+   )rq   r   rœ   rp   rJ   rG   r„   r„   Þ   s1   † ô"ð óPó ðPð ó?ó ó?rJ   r„   c                  óF   • \ rS rSrSS jr\SS j5       r\S	S j5       rSrg)
rW   éë   c                ó   • Xl         g rC   r�   r‘   s     rG   r“   Ú&RealtimeWithStreamingResponse.__init__ì   r•   rJ   c                ó@   • [        U R                  R                  5      $ rC   )r,   r�   rH   rE   s    rG   rH   Ú,RealtimeWithStreamingResponse.client_secretsï   s   € ä1°$·.±.×2OÑ2OÓPÐPrJ   c                ó@   • [        U R                  R                  5      $ rC   )r   r�   rN   rE   s    rG   rN   Ú#RealtimeWithStreamingResponse.callsó   s   € ä)¨$¯.©.×*>Ñ*>Ó?Ð?rJ   r�   Nrš   )rq   r,   )rq   r   rœ   rp   rJ   rG   rW   rW   ë   s3   † ô"ð óQó ðQð ó@ó ó@rJ   rW   c                  óF   • \ rS rSrSS jr\SS j5       r\S	S j5       rSrg)
r‡   éø   c                ó   • Xl         g rC   r�   r‘   s     rG   r“   Ú+AsyncRealtimeWithStreamingResponse.__init__ù   r•   rJ   c                ó@   • [        U R                  R                  5      $ rC   )r-   r�   rH   rE   s    rG   rH   Ú1AsyncRealtimeWithStreamingResponse.client_secretsü   s   € ä6°t·~±~×7TÑ7TÓUÐUrJ   c                ó@   • [        U R                  R                  5      $ rC   )r   r�   rN   rE   s    rG   rN   Ú(AsyncRealtimeWithStreamingResponse.calls   s   € ä.¨t¯~©~×/CÑ/CÓDÐDrJ   r�   Nr¥   )rq   r-   )rq   r   rœ   rp   rJ   rG   r‡   r‡   ø   s3   † ô"ð óVó ðVð óEó óErJ   r‡   c            	      óH  • \ rS rSr% SrS\S'   S\S'   S\S'   S	\S
'   S\S'   S\S'   SSSSS0 0 SS.                   S&S jjrS'S jrS(S jrS)S jr	S*S jr
S+S jrSSS.S,S jjrS-S jrS.S jrS/S  jr S0     S1S! jjrS2S" jr S0     S1S# jjrS/S$ jrS%rg)3ÚAsyncRealtimeConnectioni  ú:Represents a live WebSocket connection to the Realtime APIÚAsyncRealtimeSessionResourceÚsessionÚAsyncRealtimeResponseResourceÚresponseÚ%AsyncRealtimeInputAudioBufferResourceÚinput_audio_bufferÚ!AsyncRealtimeConversationResourceÚconversationÚ&AsyncRealtimeOutputAudioBufferResourceÚoutput_audio_bufferÚAsyncWebSocketConnectionÚ_connectionNrZ   r[   r\   ©Úmake_wsrd   re   rf   rg   ra   rb   Ú
send_queuec               óz  • Xl         X l        X0l        X@l        SU l        XPl        X`l        Xpl        X€l        SU l	        SU l
        U	=(       d
    [        5       U l        [        SS9U l        [        U 5      U l        [#        U 5      U l        ['        U 5      U l        [+        U 5      U l        [/        U 5      U l        g )Nr   F©Úuse_lock)rÄ   Ú_make_wsÚ_on_reconnectingÚ_max_retriesÚ_reconnect_attemptÚ_initial_delayÚ
_max_delayÚ_extra_queryÚ_extra_headersÚ_intentionally_closedÚ_is_reconnectingr&   Ú_send_queuer.   Ú_event_handler_registryr¹   rº   r»   r¼   r½   r¾   r¿   rÀ   rÁ   rÂ   ©
rF   Ú
connectionrÆ   rd   re   rf   rg   ra   rb   rÇ   s
             rG   r“   Ú AsyncRealtimeConnection.__init__  s¥   € ð &ÔØŒØ /ÔØ'ÔØ"#ˆÔØ+ÔØ#ŒØ'ÔØ+ÔØ%*ˆÔ"Ø %ˆÔØ%×4¬«ˆÔÜ';ÀUÑ'KˆÔ$ä3°DÓ9ˆŒÜ5°dÓ;ˆŒÜ"GÈÓ"MˆÔÜ=¸dÓCˆÔÜ#IÈ$Ó#OˆÕ rJ   c               ó(  #   • SSK JnJn    U R                  5       I Sh  v•N 7v •  M   N	! U a     gU aV  nU R	                  U5      I Sh  v•N  (       d-  U R
                  R                  5       nU(       a  [        SUS9Uee  SnANbSnAff = f7f©zY
An infinite-iterator that will continue to yield events until
the connection is closed.
r   )ÚConnectionClosedOKÚConnectionClosedErrorNz0WebSocket connection closed with unsent messages)Úunsent_messages©Úwebsockets.exceptionsrÜ   rÝ   ÚrecvÚ
_reconnectrÕ   Údrainr%   ©rF   rÜ   rÝ   ÚexcÚunsents        rG   Ú	__aiter__Ú!AsyncRealtimeConnection.__aiter__1  s�   é € ÷
 	TàðØ ŸI™I›K×'Ó'ñ á'øØ%ó ÙØ(ó Ø!Ÿ_™_¨SÓ1×1Ö1Ø!×-Ñ-×3Ñ3Ó5�FÞÜ<ØNØ,2ñð  #ð#ð ô 2ûðüsL   ‚
B�,  *¡, ¨Bª, ¬B²B´B¹B
ÁAÁ7B
ÂBÂ
BÂBc              ƒ  óH  #   • U R                  U R                  5       I Sh  v•N 5      n[        [        [        U5      [
        5      (       a  [        SU5      R                  S5      O[        USS5      n[        U[        5      (       a  U(       a  US:w  a  SU l	        U$  N~7f)ú¡
Receive the next message from the connection and parses it into a `RealtimeServerEvent` object.

Canceling this method is safe. There's no risk of losing data.
Núdict[str, object]ÚtypeÚerrorr   ©
Úparse_eventÚ
recv_bytesÚ
isinstancer   ÚobjectÚdictÚgetÚgetattrÚstrrÎ   ©rF   ÚeventÚ
event_types      rG   rá   ÚAsyncRealtimeConnection.recvG  sŠ   é € ð × Ñ  t§¡Ó'8×!8Ó9ˆô œ$œv uÓ-¬t×4Ñ4ô Ð$ eÓ,×0Ñ0°Ô8ä˜ ¨Ó-ð 	ô �j¤#×&Ñ&®:¸*ÈÓ:OØ&'ˆDÔ#Øˆñ "9ùs   ‚B"¡B ¢A?B"c              ƒ  óÈ  #   • U R                   R                  SS9I Sh  v•N n[        R                  S[	        U5      5        U R
                  (       ar   [        R                  " U5      n[        U[        5      (       a  [        SU5      R                  S5      OSn[        U[        5      (       a  U(       a  US:w  a  SU l        U$  N¨! [        [        4 a    Us $ f = f7f)	úþReceive the next message from the connection as raw bytes.

Canceling this method is safe. There's no risk of losing data.

If you want to parse the message into a `RealtimeServerEvent` object like `.recv()` does,
then you can call `.parse_event(data)`.
F©ÚdecodeNú$Received WebSocket message: %i bytesrë   rì   rí   r   ©rÄ   rá   r?   ÚdebugÚlenrÎ   ÚjsonÚloadsÚ
ValueErrorÚRecursionErrorrñ   ró   r   rô   rö   ©rF   ÚmessageÚ
event_datarù   s       rG   rð   Ú"AsyncRealtimeConnection.recv_bytesY  sÁ   é € ð ×(Ñ(×-Ñ-°UÐ-Ð;×;ˆÜ�	‰	Ð8¼#¸g»,ÔGØ×"×"ðÜ%)§Z¢Z°Ó%8�
ô OYÐYcÔei×NjÑNjœÐ1°:Ó>×BÑBÀ6ÔJÐptˆJÜ˜*¤c×*Ñ*®z¸jÈGÓ>SØ*+�Ô'Øˆñ <øô ¤Ð/ó Ø’ðüs4   ‚C"ŸC 4C"ÁC
 Á+AC"Ã
CÃC"ÃCÃC"c              ƒ  ó®  #   • [        U[        5      (       a  UR                  SSSS9O+[        R                  " [        U[        5      I S h  v•N 5      nU R                  (       a  U R                  R                  U5        g  U R                  R                  U5      I S h  v•N   g  NZ N! [         a    U R                  R                  U5        e f = f7f©NT©Úuse_api_namesÚexclude_defaultsÚexclude_unset)rñ   r   Úto_jsonr  Údumpsr   r8   rÔ   rÕ   ÚenqueuerÄ   ÚsendÚ	Exception©rF   rø   Údatas      rG   r  ÚAsyncRealtimeConnection.sendn  s·   é € ô ˜%¤×+Ñ+ð �M‰M¨¸tÐSWˆMÑXä—’Ô"7¸Ô?WÓ"X×XÓYð 	ð
 × × Ø×Ñ×$Ñ$ TÔ*Øð	Ø×"Ñ"×'Ñ'¨Ó-×-Ñ-ñ Yñ .øÜó 	Ø×Ñ×$Ñ$ TÔ*Øð	üs<   ‚A
CÁB'Á5CÂB+ Â!B)Â"B+ Â&CÂ)B+ Â+'CÃCc              ƒ  ó   #   • U R                   (       aD  [        U[        5      (       a  UOUR                  S5      nU R                  R                  U5        g U R                  R                  U5      I S h  v•N   g  N7f©Nzutf-8©rÔ   rñ   rö   rþ   rÕ   r  rÄ   r  ©rF   r  Úraws      rG   Úsend_rawÚ AsyncRealtimeConnection.send_raw}  s[   é € Ø× × Ü$ T¬3×/Ñ/‘$°T·[±[ÀÓ5IˆCØ×Ñ×$Ñ$ SÔ)ØØ×Ñ×#Ñ# DÓ)×)Ó)ùs   ‚A4A>Á6A<Á7A>éè  Ú ©ÚcodeÚreasonc             ƒ  ó`   #   • SU l         U R                  R                  XS9I S h  v•N   g  N7f©NTr"  ©rÓ   rÄ   Úclose©rF   r#  r$  s      rG   r(  ÚAsyncRealtimeConnection.close„  s*   é € Ø%)ˆÔ"Ø×Ñ×$Ñ$¨$Ð$Ð>×>Ó>ùs   ‚$.¦,§.c           
     ó~   • [        [        [        [        R                  " U5      [        [
        [        5      S95      $ ©z€
Converts a raw `str` or `bytes` message into a `RealtimeServerEvent` object.

This is helpful if you're using `.recv_bytes()`.
)ÚvalueÚtype_©r   r6   r!   r  r  r   ©rF   r  s     rG   rï   Ú#AsyncRealtimeConnection.parse_eventˆ  ó1   € ô ÜÔ!9ÄÇ
Â
È4Ó@PÔX\Ô]`ÔbuÓXvÑ!wó
ð 	
rJ   c           
   ƒ  óÖ  #   • SSK nU R                  b  U R                  c  gSSKJn  Sn[        X5      (       a#  UR                  b  UR                  R                  n[        U5      (       d  gSU l	        [        U R                  S-   U R                  S-   5       GH‘  nXPl        [        U R                  SUS-
  -  -  U R                  5      nS	[         R                   " 5       S
-  -   nXg-  n[#        UU R                  UUU R$                  U R&                  S9n	 U R                  U	5      n
U
b  U
R+                  S5      (       a	  SU l	          gU
b   SU
;   a
  U
S   U l        SU
;   a
  U
S   U l        [,        R/                  SUU R                  U5        UR1                  U5      I Sh  v•N   U R2                  (       a	  SU l	          g U R                  U R$                  U R&                  5      I Sh  v•N U l        [,        R/                  S5        SU l	        U R7                  5       I Sh  v•N     g   SU l	        g! [(         a    SU l	           gf = f Nª Nc N,! [(         a     GMÊ  f = f7f)ú¨Attempt to reconnect after a connection failure.

Returns ``True`` if a new connection was established, ``False`` if the
caller should re-raise the original exception.
r   NF©rÝ   éî  Tr   é   ç      è?ç      Ð?©ÚattemptÚmax_attemptsÚdelayÚ
close_codera   rb   Úabortra   rb   ú?Reconnecting to WebSocket API (attempt %d/%d) after %.1fs delayúReconnected to WebSocket API)ÚasynciorÌ   rË   rà   rÝ   rñ   Úrcvdr#  r2   rÔ   ÚrangerÎ   rÍ   ÚminrÏ   rÐ   Úrandomr0   rÑ   rÒ   r  rô   r?   ÚinfoÚsleeprÓ   rÄ   Ú_flush_send_queue)rF   rå   rB  rÝ   r>  r;  Ú
base_delayÚjitterr=  rø   Úresults              rG   râ   Ú"AsyncRealtimeConnection._reconnect’  sH  é € ó 	à× Ñ Ñ(¨D¯M©MÑ,AØå?àˆ
Ü�c×1Ñ1°c·h±hÑ6JØŸ™Ÿ™ˆJä# J×/Ñ/Øà $ˆÔä˜T×4Ñ4°qÑ8¸$×:KÑ:KÈaÑ:O×PˆGØ&-Ô#Ü˜T×0Ñ0°A¸'ÀA¹+Ñ4FÑGÈÏÉÓYˆJØœFŸMšM›O¨dÑ2Ñ2ˆFØÑ'ˆEä%ØØ!×.Ñ.ØØ%Ø ×-Ñ-Ø"×1Ñ1ñˆEðØ×.Ñ.¨uÓ5�ð
 Ñ! f§j¡j°×&9Ñ&9Ø(-�Ô%ÙàÑ!Ø  FÓ*Ø(.¨}Ñ(=�DÔ%Ø" fÓ,Ø*0°Ñ*A�DÔ'ä�H‰HØQØØ×!Ñ!Øô	ð —-‘- Ó&×&Ð&à×)×)Ø(-�Ô%ÙðØ)-¯©°t×7HÑ7HÈ$×J]ÑJ]Ó)^×#^�Ô Ü—‘Ð7Ô8Ø(-�Ô%Ø×,Ñ,Ó.×.Ð.Ùña Qðh !&ˆÔØøôI ó Ø(-�Ô%Úðúñ( 'ñ $_ñ /øäó Ûðüs   ‚DI)ÄH9Ä+A;I)Æ&IÆ'I)Ç)IÇ/IÇ08IÈ(IÈ)IÈ-I)È9IÉ
I)ÉIÉI)ÉIÉIÉ
I&É!I)É%I&É&I)c              ƒ  ó´   ^ #   • SU 4S jjn T R                   R                  U5      I Sh  v•N   g N! [         a    [        R	                  S5         gf = f7f)ú5Send all queued messages over the current connection.c              “  óX   >#   • TR                   R                  U 5      I S h  v•N   g  N7frC   ©rÄ   r  ©r  rF   s    €rG   Ú_sendÚ8AsyncRealtimeConnection._flush_send_queue.<locals>._sendâ  s    øé € Ø×"Ñ"×'Ñ'¨Ó-×-Ó-ùs   ƒ*¢(£*Nú*Failed to flush send queue after reconnect)r  rö   rq   r›   )rÕ   Úflush_asyncr  r?   Úwarning)rF   rS  s   ` rG   rI  Ú)AsyncRealtimeConnection._flush_send_queueß  sH   øé € ÷	.ð	FØ×"Ñ"×.Ñ.¨uÓ5×5Ó5øÜó 	FÜ�K‰KÐDÖEð	Füs1   ƒ	A�3 «1¬3 °A±3 ³AÁAÁAÁAc                ó^   ^ ^• Ub  T R                   R                  TU5        T $ SUU 4S jjnU$ )aï  Adds the handler to the end of the handlers list for the given event type.

No checks are made to see if the handler has already been added. Multiple calls
passing the same combination of event type and handler will result in the handler
being added, and called, multiple times.

Can be used as a method (returns ``self`` for chaining)::

    connection.on("conversation.created", my_handler)

Or as a decorator::

    @connection.on("conversation.created")
    async def my_handler(event): ...
c                ó@   >• TR                   R                  TU 5        U $ rC   ©rÖ   Úadd©Úfnrù   rF   s    €€rG   Ú	decoratorÚ-AsyncRealtimeConnection.on.<locals>.decorator   ó   ø€ Ø×(Ñ(×,Ñ,¨Z¸Ô<ØˆIrJ   ©r^  úCallable[..., Any]rq   rc  r[  ©rF   rù   Úhandlerr_  s   ``  rG   ÚonÚAsyncRealtimeConnection.onê  ó8   ù€ ð$ ÑØ×(Ñ(×,Ñ,¨Z¸ÔAØˆK÷	ð 	ð ÐrJ   c                ó<   • U R                   R                  X5        U $ ©z-Remove a previously registered event handler.©rÖ   Úremove©rF   rù   re  s      rG   ÚoffÚAsyncRealtimeConnection.off  ó   € à×$Ñ$×+Ñ+¨JÔ@ØˆrJ   c                ó\   ^ ^• Ub  T R                   R                  TUSS9  T $ SUU 4S jjnU$ )úRRegister a one-time event handler.

Automatically removed after first invocation.
T©Úoncec                ó>   >• TR                   R                  TU SS9  U $ ©NTrs  r[  r]  s    €€rG   r_  Ú/AsyncRealtimeConnection.once.<locals>.decorator  ó#   ø€ Ø×(Ñ(×,Ñ,¨Z¸À$Ð,ÑGØˆIrJ   rb  r[  rd  s   ``  rG   rt  ÚAsyncRealtimeConnection.once  ó=   ù€ ð ÑØ×(Ñ(×,Ñ,¨Z¸ÀtÐ,ÑLØˆK÷	ð 	ð ÐrJ   c              ƒ  óú  #   • SSK nU   Sh  v•N nUR                  nU R                  R                  U5      nU R                  R                  S5      nUS:X  a1  U(       d*  U(       d#  [	        U[
        5      (       a  [        SU 35      eU H-  nU" U5      nUR                  U5      (       d  M#  UI Sh  v•N   M/     U H-  nU" U5      nUR                  U5      (       d  M#  UI Sh  v•N   M/     Mê   Nå N? N
 g7f)aD  Run the event loop, dispatching received events to registered handlers.

Blocks until the connection is closed. This is the push-based
alternative to iterating with ``async for event in connection``.

If an ``"error"`` event arrives and no handler is registered for
``"error"`` or ``"event"``, an ``OpenAIError`` is raised.
r   Nrø   rí   úWebSocket error: )rB  rì   rÖ   Úget_handlersrñ   r4   r$   Úiscoroutine)rF   rB  rø   rù   ÚspecificÚgenericre  rL  s           rG   Údispatch_eventsÚ'AsyncRealtimeConnection.dispatch_events  sâ   é € ó 	á÷ 	!�%ØŸ™ˆJØ×3Ñ3×@Ñ@ÀÓLˆHØ×2Ñ2×?Ñ?ÀÓHˆGà˜WÓ$®X¾gÜ˜eÔ%7×8Ñ8Ü%Ð(9¸%¸Ð&AÓBÐBã#�Ù  ›�Ø×&Ñ& v×.Ó.Ø —L’Lñ $ó
 #�Ù  ›�Ø×&Ñ& v×.Ó.Ø —L’Ló #ñ	!ñ !ñ
 !ñ#  ùsV   ‚C;‰C9�C3ŽC9‘BC;Â0C;Â5C5Â6)C;Ã#C;Ã(C7Ã)
C;Ã3C9Ã5C;Ã7C;Ã9C;©rÄ   rÖ   rÒ   rÑ   rÏ   rÓ   rÔ   rË   rÐ   rÍ   rÌ   rÎ   rÕ   rÀ   r¾   rÂ   r¼   rº   )rØ   rÃ   rÆ   zFCallable[[Query, Headers], Awaitable[AsyncWebSocketConnection]] | Nonerd   rs   re   rt   rf   ru   rg   ru   ra   r   rb   r   rÇ   úSendQueue | Nonerq   r›   )rq   z"AsyncIterator[RealtimeServerEvent]©rq   r6   ©rq   Úbytes©rø   z.RealtimeClientEvent | RealtimeClientEventParamrq   r›   ©r  zbytes | strrq   r›   ©r#  rt   r$  rö   rq   r›   ©r  zstr | bytesrq   r6   ©rå   r  rq   Úbool©rq   r›   rC   )rù   rö   re  úCallable[..., Any] | Nonerq   zRUnion[AsyncRealtimeConnection, Callable[[Callable[..., Any]], Callable[..., Any]]])rù   rö   re  rc  rq   r·   )rw   rx   ry   rz   Ú__doc__Ú__annotations__r“   rç   rá   rð   r  r  r(  rï   râ   rI  rf  rn  rt  r�  r{   rp   rJ   rG   r·   r·     sC  ‡ ÙDà)Ó)Ø+Ó+Ø=Ó=Ø3Ó3Ø?Ó?à)Ó)ð [_Ø^bØØ"ØØØ!#Ø'+ñPà,ðPð Xð	Pð
 \ðPð ðPð ðPð ðPð ðPð ðPð %ðPð 
õPôBô,ô$ô*ô*ð *.¸R÷ ?ô
ôKôZ	Fð EIðØðØ(Aðà	[õô8ð EIðØðØ(Aðà	[õ÷"!rJ   r·   c                  óè   • \ rS rSrSr\\SSSSSS.                       SS	 jjrSS
 jr S     SS jjrSS jr	 S     SS jjr
SS jr\rSS jrSS jr        SS jrSrg)rŠ   i;  aù  
Context manager over a `AsyncRealtimeConnection` that is returned by `realtime.connect()`

This context manager ensures that the connection will be closed when it exits.

---

Note that if your application doesn't work well with the context manager approach then you
can call the `.enter()` method directly to initiate a connection.

**Warning**: You must remember to close the connection with `.close()`.

```py
connection = await client.realtime.connect(...).enter()
# ...
await connection.close()
```
NrZ   r[   r\   r]   ©r_   r`   rd   re   rf   rg   rh   c               óÂ   • Xl         X l        X0l        S U l        X@l        XPl        X`l        Xpl        X€l        X�l	        X l
        [        US9U l        [        SS9U l        g )N©Ú	max_bytesFrÉ   )Ú'_AsyncRealtimeConnectionManager__clientÚ(_AsyncRealtimeConnectionManager__call_idÚ&_AsyncRealtimeConnectionManager__modelÚ+_AsyncRealtimeConnectionManager__connectionÚ,_AsyncRealtimeConnectionManager__extra_queryÚ._AsyncRealtimeConnectionManager__extra_headersÚ=_AsyncRealtimeConnectionManager__websocket_connection_optionsÚ0_AsyncRealtimeConnectionManager__on_reconnectingÚ,_AsyncRealtimeConnectionManager__max_retriesÚ._AsyncRealtimeConnectionManager__initial_delayÚ*_AsyncRealtimeConnectionManager__max_delayr&   Ú+_AsyncRealtimeConnectionManager__send_queuer.   Ú7_AsyncRealtimeConnectionManager__event_handler_registry©rF   rk   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   s               rG   r“   Ú'AsyncRealtimeConnectionManager.__init__O  s_   € ð ŒØ ŒØŒØ<@ˆÔØ(ÔØ,ÔØ.JÔ+Ø!0ÔØ(ÔØ,ÔØ$ÔÜ%°Ñ?ˆÔÜ(<ÀeÑ(LˆÕ%rJ   c                ó²   • [        U[        5      (       a  UR                  SSSS9O[        R                  " U5      nU R
                  R                  U5        g©zÄQueue a message to be sent when the connection is established.

This can be called before entering the context manager. Queued messages
are automatically sent once the WebSocket connection opens.
Tr  N)rñ   r   r  r  r  r¢  r  r  s      rG   r  Ú#AsyncRealtimeConnectionManager.sendl  óM   € ô ˜%¤×+Ñ+ð �M‰M¨¸tÐSWˆMÑXä—’˜EÓ"ð 	ð
 	×Ñ×!Ñ! $Õ'rJ   c                ó^   ^ ^• Ub  T R                   R                  TU5        T $ SUU 4S jjnU$ )zÆRegister an event handler before the connection is established.

Handlers are transferred to the connection on enter. Supports the
same method and decorator forms as ``AsyncRealtimeConnection.on``.
c                ó@   >• TR                   R                  TU 5        U $ rC   ©r£  r\  r]  s    €€rG   r_  Ú4AsyncRealtimeConnectionManager.on.<locals>.decorator…  ó   ø€ Ø×)Ñ)×-Ñ-¨j¸"Ô=ØˆIrJ   rb  r¬  rd  s   ``  rG   rf  Ú!AsyncRealtimeConnectionManager.ony  ó8   ù€ ð ÑØ×)Ñ)×-Ñ-¨j¸'ÔBØˆK÷	ð 	ð ÐrJ   c                ó<   • U R                   R                  X5        U $ rj  )r£  rl  rm  s      rG   rn  Ú"AsyncRealtimeConnectionManager.off‹  ó   € à×%Ñ%×,Ñ,¨ZÔAØˆrJ   c                ó\   ^ ^• Ub  T R                   R                  TUSS9  T $ SUU 4S jjnU$ )úGRegister a one-time event handler before the connection is established.Trs  c                ó>   >• TR                   R                  TU SS9  U $ rv  r¬  r]  s    €€rG   r_  Ú6AsyncRealtimeConnectionManager.once.<locals>.decorator˜  ó#   ø€ Ø×)Ñ)×-Ñ-¨j¸"À4Ð-ÑHØˆIrJ   rb  r¬  rd  s   ``  rG   rt  Ú#AsyncRealtimeConnectionManager.once�  ó=   ù€ ð ÑØ×)Ñ)×-Ñ-¨j¸'ÈÐ-ÑMØˆK÷	ð 	ð ÐrJ   c              ƒ  ó  #   • U R                  U R                  U R                  5      I Sh  v•N n[        UU R                  b  U R                   OSU R                  U R
                  U R                  U R                  U R                  U R                  U R                  S9	U l	        U R                  R                  U R                  R                  5        U R                  R                  5       I Sh  v•N   U R                  $  NÖ N7f)a5  
If your application doesn't work well with the context manager approach then you
can call this method directly to initiate a connection.

**Warning**: You must remember to close the connection with `.close()`.

```py
connection = await client.realtime.connect(...).enter()
# ...
await connection.close()
```
NrÅ   )Ú_connect_wsr›  rœ  r·   rž  rŸ  r   r¡  r¢  rš  r£  Ú
merge_intorÖ   rI  ©rF   Úwss     rG   Ú
__aenter__Ú)AsyncRealtimeConnectionManager.__aenter__ž  sß   é € ð ×#Ñ# D×$6Ñ$6¸×8LÑ8LÓM×Mˆä3ØØ(,×(>Ñ(>Ñ(J�D×$Ò$ÐPTØ ×2Ñ2Ø×*Ñ*Ø×.Ñ.Ø×&Ñ&Ø×*Ñ*Ø×.Ñ.Ø×(Ñ(ñ

ˆÔð 	×%Ñ%×0Ñ0°×1BÑ1B×1ZÑ1ZÔ[Ø×Ñ×1Ñ1Ó3×3Ð3à× Ñ Ð ñ# Nñ 	4ùs"   ‚*D¬D­CDÃ2DÃ3DÄDc              ƒ  ó®  #   •  SSK Jn  U R                  R                  5       I S h  v•N   U R                  R                  nU R                  [        La  0 UESU R                  0En[        U R                  5      (       aJ  SSK
Jn  U R                  nU(       d  [        S5      eU R                  R                  Xa5      I S h  v•N u  puObU R                  5       R                  0 U R                  R                   R"                  EU R                  [        La  SU R                  0O0 EUES9n[$        R'                  S	5        U R(                  (       a  [$        R'                  S
5        U" [+        U5      4U R                  R,                  [/        0 UEU5      S.U R(                  D6I S h  v•N $ ! [         a  n[        S5      UeS nAff = f GN¦ GN N(7f)Nr   )Ú_WebSocketConnectú9You need to install `openai[realtime]` to use this methodr_   )Ú_AzureWebSocketConnectú*`model` is required for Azure Realtime APIr`   ©ÚparamsúConnecting to WebSocket APIú,Custom WebSocket connection options provided©Úuser_agent_headerÚadditional_headers)Úlib._websocketrÃ  ÚImportErrorr$   r—  Ú_refresh_api_keyÚauth_headersr˜  r   r   Úlib._azure_websocketrÅ  r™  Ú_configure_realtimeÚ_prepare_urlÚ	copy_withÚbase_urlrÈ  r?   r  r�  rö   Ú
user_agentr'   ©rF   ra   rb   rn   rå   rÑ  r`   Úurls           rG   r¼  Ú*AsyncRealtimeConnectionManager._connect_wsÀ  s­  é € ð	dÝFð �m‰m×,Ñ,Ó.×.Ð.Ø—}‘}×1Ñ1ˆØ�>‰>¤Ò%ØD˜[ÐD¨)°T·^±^ÑDˆKÜ  §¡×/Ñ/ÝQà—L‘LˆEÞÜ!Ð"NÓOÐOà*.¯-©-×*KÑ*KÈEÓ*_×$_Ñ!��\à×#Ñ#Ó%×/Ñ/ðØ—m‘m×,Ñ,×3Ñ3ðà26·,±,ÄdÒ2J˜ §¡Ñ.ÐPRðð "ðð 0ð ˆCô 	�	‰	Ð/Ô0Ø×.×.Ü�I‰IÐDÔEáÜ�‹Hð

à"Ÿm™m×6Ñ6Ü.ðØ"ðð ó	 ñ

ð ×1Ñ1ñ

÷ 

ð 
	
øô7 ó 	dÜÐYÓZÐ`cÐcûð	dúò 	/ò %`ñ

ùsW   ‚G„F/ ŠG§G¨BGÃGÃC&GÆ*GÆ+GÆ/
G
Æ9GÇG
Ç
GÇGÇGc                ód  • U R                   R                  b   [        U R                   R                  5      nOMU R                   R                  R                  nUS:X  a  SOSnU R                   R                  R                  US9nUR                  R                  S5      S-   nUR                  US9$ ©NÚhttpr¿  Úwss)Úschemeó   /s	   /realtime)Úraw_path)r—  Úwebsocket_base_urlr    Ú	_base_urlrß  rÕ  rá  Úrstrip©rF   rÖ  rß  Ú	ws_schemeÚmerge_raw_paths        rG   rÔ  Ú+AsyncRealtimeConnectionManager._prepare_urlê  ó•   € Ø�=‰=×+Ñ+Ñ7Ü*¨4¯=©=×+KÑ+KÓL‰Hà—]‘]×,Ñ,×3Ñ3ˆFØ &¨&Ó 0™°eˆIØ—}‘}×.Ñ.×8Ñ8À	Ð8ÐJˆHà!×*Ñ*×1Ñ1°$Ó7¸,ÑFˆØ×!Ñ!¨>Ð!Ð:Ð:rJ   c              ƒ  óp   #   • U R                   b#  U R                   R                  5       I S h  v•N   g g  N7frC   )rš  r(  ©rF   Úexc_typerå   Úexc_tbs       rG   Ú	__aexit__Ú(AsyncRealtimeConnectionManager.__aexit__õ  s3   é € ð ×ÑÑ(Ø×#Ñ#×)Ñ)Ó+×+Ñ+ð )Ù+ùs   ‚+6­4®6©Ú	__call_idÚ__clientÚ__connectionÚ__event_handler_registryÚ__extra_headersÚ__extra_queryÚ__initial_delayÚ__max_delayÚ__max_retriesÚ__modelÚ__on_reconnectingÚ__send_queueÚ__websocket_connection_options)rk   r<   r_   rr   r`   rr   ra   r   rb   r   rc   r3   rd   rs   re   rt   rf   ru   rg   ru   rh   rt   rq   r›   rˆ  rC   )rù   rö   re  r�  rq   zYUnion[AsyncRealtimeConnectionManager, Callable[[Callable[..., Any]], Callable[..., Any]]])rù   rö   re  rc  rq   rŠ   )rq   r·   )ra   r   rb   r   rq   rÃ   ©rq   z
httpx2.URL©rì  ztype[BaseException] | Nonerå   zBaseException | Nonerí  zTracebackType | Nonerq   r›   )rw   rx   ry   rz   r�  r   r“   r  rf  rn  rt  rÀ  Úenterr¼  rÔ  rî  r{   rp   rJ   rG   rŠ   rŠ   ;  s=  † ñð. #Ø ð _cØØ"ØØ'ñMð ðMð ð	Mð
 ðMð ðMð ðMð 'AðMð \ðMð ðMð ðMð ðMð ðMð 
õMô:(ð EIðØðØ(Aðà	bõô$ð EIðØðØ(Aðà	bõô!ð@ €Eô(
ôT	;ð,Ø2ð,Ø9Mð,ØWkð,à	÷,rJ   rŠ   c            	      óH  • \ rS rSr% SrS\S'   S\S'   S\S'   S	\S
'   S\S'   S\S'   SSSSS0 0 SS.                   S&S jjrS'S jrS(S jrS)S jr	S*S jr
S+S jrSSS.S,S jjrS-S jrS.S jrS/S  jr S0     S1S! jjrS2S" jr S0     S1S# jjrS/S$ jrS%rg)3ÚRealtimeConnectioniü  r¸   ÚRealtimeSessionResourcerº   ÚRealtimeResponseResourcer¼   Ú RealtimeInputAudioBufferResourcer¾   ÚRealtimeConversationResourcerÀ   Ú!RealtimeOutputAudioBufferResourcerÂ   ÚWebSocketConnectionrÄ   NrZ   r[   r\   rÅ   c               óz  • Xl         X l        X0l        X@l        SU l        XPl        X`l        Xpl        X€l        SU l	        SU l
        U	=(       d
    [        5       U l        [        SS9U l        [        U 5      U l        [#        U 5      U l        ['        U 5      U l        [+        U 5      U l        [/        U 5      U l        g )Nr   FTrÉ   )rÄ   rË   rÌ   rÍ   rÎ   rÏ   rÐ   rÑ   rÒ   rÓ   rÔ   r&   rÕ   r.   rÖ   r  rº   r  r¼   r  r¾   r  rÀ   r  rÂ   r×   s
             rG   r“   ÚRealtimeConnection.__init__  s¥   € ð &ÔØŒØ /ÔØ'ÔØ"#ˆÔØ+ÔØ#ŒØ'ÔØ+ÔØ%*ˆÔ"Ø %ˆÔØ%×4¬«ˆÔÜ';ÀTÑ'JˆÔ$ä.¨tÓ4ˆŒÜ0°Ó6ˆŒÜ"BÀ4Ó"HˆÔÜ8¸Ó>ˆÔÜ#DÀTÓ#JˆÕ rJ   c              #  ó   #   • SSK JnJn    U R                  5       v •  M  ! U a     gU aM  nU R	                  U5      (       d-  U R
                  R                  5       nU(       a  [        SUS9Uee  SnANWSnAff = f7frÛ   rß   rä   s        rG   Ú__iter__ÚRealtimeConnection.__iter__(  sˆ   é € ÷
 	TàðØ—i‘i“kÒ!ñ øð &ó ÙØ(ó Ø—‘ s×+Ñ+Ø!×-Ñ-×3Ñ3Ó5�FÞÜ<ØNØ,2ñð  #ð#ð ô ,ûðüs5   ‚
A>�! ŸA>¡A;§A>©A;®AA6Á1A>Á6A;Á;A>c                ó,  • U R                  U R                  5       5      n[        [        [        U5      [
        5      (       a  [        SU5      R                  S5      O[        USS5      n[        U[        5      (       a  U(       a  US:w  a  SU l	        U$ )rê   rë   rì   Nrí   r   rî   r÷   s      rG   rá   ÚRealtimeConnection.recv>  s   € ð × Ñ  §¡Ó!2Ó3ˆô œ$œv uÓ-¬t×4Ñ4ô Ð$ eÓ,×0Ñ0°Ô8ä˜ ¨Ó-ð 	ô �j¤#×&Ñ&®:¸*ÈÓ:OØ&'ˆDÔ#ØˆrJ   c                ó¬  • U R                   R                  SS9n[        R                  S[	        U5      5        U R
                  (       ar   [        R                  " U5      n[        U[        5      (       a  [        SU5      R                  S5      OSn[        U[        5      (       a  U(       a  US:w  a  SU l        U$ ! [        [        4 a    Us $ f = f)	rü   Frý   rÿ   rë   rì   Nrí   r   r   r  s       rG   rð   ÚRealtimeConnection.recv_bytesP  s·   € ð ×"Ñ"×'Ñ'¨uÐ'Ð5ˆÜ�	‰	Ð8¼#¸g»,ÔGØ×"×"ðÜ%)§Z¢Z°Ó%8�
ô OYÐYcÔei×NjÑNjœÐ1°:Ó>×BÑBÀ6ÔJÐptˆJÜ˜*¤c×*Ñ*®z¸jÈGÓ>SØ*+�Ô'Øˆøô ¤Ð/ó Ø’ðús   ÁB> Â>CÃCc                ó~  • [        U[        5      (       a  UR                  SSSS9O#[        R                  " [        U[        5      5      nU R                  (       a  U R                  R                  U5        g  U R                  R                  U5        g ! [         a    U R                  R                  U5        e f = fr  )rñ   r   r  r  r  r   r8   rÔ   rÕ   r  rÄ   r  r  r  s      rG   r  ÚRealtimeConnection.sende  s    € ô ˜%¤×+Ñ+ð �M‰M¨¸tÐSWˆMÑXä—’œO¨EÔ3KÓLÓMð 	ð
 × × Ø×Ñ×$Ñ$ TÔ*Øð	Ø×Ñ×!Ñ! $Õ'øÜó 	Ø×Ñ×$Ñ$ TÔ*Øð	ús   Á9B Â'B<c                óä   • U R                   (       aD  [        U[        5      (       a  UOUR                  S5      nU R                  R                  U5        g U R                  R                  U5        g r  r  r  s      rG   r  ÚRealtimeConnection.send_rawt  sR   € Ø× × Ü$ T¬3×/Ñ/‘$°T·[±[ÀÓ5IˆCØ×Ñ×$Ñ$ SÔ)ØØ×Ñ×Ñ˜dÕ#rJ   r   r!  r"  c               óD   • SU l         U R                  R                  XS9  g r&  r'  r)  s      rG   r(  ÚRealtimeConnection.close{  s!   € Ø%)ˆÔ"Ø×Ñ×Ñ DÐÒ8rJ   c           
     ó~   • [        [        [        [        R                  " U5      [        [
        [        5      S95      $ r,  r/  r0  s     rG   rï   ÚRealtimeConnection.parse_event  r2  rJ   c           
     ó”  • U R                   b  U R                  c  gSSKJn  Sn[	        X5      (       a#  UR
                  b  UR
                  R                  n[        U5      (       d  gSU l        [        U R                  S-   U R                  S-   5       GH~  nX@l
        [        U R                  SUS-
  -  -  U R                  5      nS[        R                  " 5       S	-  -   nXV-  n[!        UU R                  UUU R"                  U R$                  S
9n U R                  U5      n	U	b  U	R)                  S5      (       a	  SU l          gU	b   SU	;   a
  U	S   U l        SU	;   a
  U	S   U l        [*        R-                  SUU R                  U5        [.        R0                  " U5        U R2                  (       a	  SU l          g U R                  U R"                  U R$                  5      U l        [*        R-                  S5        SU l        U R7                  5           g   SU l        g! [&         a    SU l           gf = f! [&         a     GM±  f = f)r4  Fr   r5  r6  Tr   r7  r8  r9  r:  r?  ra   rb   r@  rA  )rÌ   rË   rà   rÝ   rñ   rC  r#  r2   rÔ   rD  rÎ   rÍ   rE  rÏ   rÐ   rF  r0   rÑ   rÒ   r  rô   r?   rG  ÚtimerH  rÓ   rÄ   rI  )
rF   rå   rÝ   r>  r;  rJ  rK  r=  rø   rL  s
             rG   râ   ÚRealtimeConnection._reconnect‰  s&  € ð × Ñ Ñ(¨D¯M©MÑ,AØå?àˆ
Ü�c×1Ñ1°c·h±hÑ6JØŸ™Ÿ™ˆJä# J×/Ñ/Øà $ˆÔä˜T×4Ñ4°qÑ8¸$×:KÑ:KÈaÑ:O×PˆGØ&-Ô#Ü˜T×0Ñ0°A¸'ÀA¹+Ñ4FÑGÈÏÉÓYˆJØœFŸMšM›O¨dÑ2Ñ2ˆFØÑ'ˆEä%ØØ!×.Ñ.ØØ%Ø ×-Ñ-Ø"×1Ñ1ñˆEðØ×.Ñ.¨uÓ5�ð
 Ñ! f§j¡j°×&9Ñ&9Ø(-�Ô%ÙàÑ!Ø  FÓ*Ø(.¨}Ñ(=�DÔ%Ø" fÓ,Ø*0°Ñ*A�DÔ'ä�H‰HØQØØ×!Ñ!Øô	ô �JŠJ�uÔà×)×)Ø(-�Ô%ÙðØ#'§=¡=°×1BÑ1BÀD×DWÑDWÓ#X�Ô Ü—‘Ð7Ô8Ø(-�Ô%Ø×&Ñ&Ô(Ùña Qðh !&ˆÔØøôI ó Ø(-�Ô%Úðûô@ ó Ûðús%   ÄH Æ=AH8È H5È4H5È8
IÉIc                ó�   ^ •  T R                   R                  U 4S j5        g! [         a    [        R	                  S5         gf = f)rO  c                ó:   >• TR                   R                  U 5      $ rC   rQ  rR  s    €rG   Ú<lambda>Ú6RealtimeConnection._flush_send_queue.<locals>.<lambda>×  s   ø€ °T×5EÑ5E×5JÑ5JÈ4Ô5PrJ   rU  N)rÕ   Ú
flush_syncr  r?   rW  rE   s   `rG   rI  Ú$RealtimeConnection._flush_send_queueÔ  s<   ø€ ð	FØ×Ñ×'Ñ'Ô(PÕQøÜó 	FÜ�K‰KÐDÖEð	Fús   ƒ# £AÁAc                ó^   ^ ^• Ub  T R                   R                  TU5        T $ SUU 4S jjnU$ )aé  Adds the handler to the end of the handlers list for the given event type.

No checks are made to see if the handler has already been added. Multiple calls
passing the same combination of event type and handler will result in the handler
being added, and called, multiple times.

Can be used as a method (returns ``self`` for chaining)::

    connection.on("conversation.created", my_handler)

Or as a decorator::

    @connection.on("conversation.created")
    def my_handler(event): ...
c                ó@   >• TR                   R                  TU 5        U $ rC   r[  r]  s    €€rG   r_  Ú(RealtimeConnection.on.<locals>.decoratorñ  ra  rJ   rb  r[  rd  s   ``  rG   rf  ÚRealtimeConnection.onÛ  rh  rJ   c                ó<   • U R                   R                  X5        U $ rj  rk  rm  s      rG   rn  ÚRealtimeConnection.off÷  rp  rJ   c                ó\   ^ ^• Ub  T R                   R                  TUSS9  T $ SUU 4S jjnU$ )rr  Trs  c                ó>   >• TR                   R                  TU SS9  U $ rv  r[  r]  s    €€rG   r_  Ú*RealtimeConnection.once.<locals>.decorator  rx  rJ   rb  r[  rd  s   ``  rG   rt  ÚRealtimeConnection.onceü  rz  rJ   c                óL  • U  Hž  nUR                   nU R                  R                  U5      nU R                  R                  S5      nUS:X  a1  U(       d*  U(       d#  [        U[        5      (       a  [        SU 35      eU H  nU" U5        M     U H  nU" U5        M     M      g)aQ  Run the event loop, dispatching received events to registered handlers.

Blocks the current thread until the connection is closed. This is the push-based
alternative to iterating with ``for event in connection``.

If an ``"error"`` event arrives and no handler is registered for
``"error"`` or ``"event"``, an ``OpenAIError`` is raised.
rø   rí   r|  N)rì   rÖ   r}  rñ   r4   r$   )rF   rø   rù   r  r€  re  s         rG   r�  Ú"RealtimeConnection.dispatch_events  s”   € ó ˆEØŸ™ˆJØ×3Ñ3×@Ñ@ÀÓLˆHØ×2Ñ2×?Ñ?ÀÓHˆGà˜WÓ$®X¾gÜ˜eÔ%7×8Ñ8Ü%Ð(9¸%¸Ð&AÓBÐBã#�Ù˜–ñ $ó #�Ù˜–ó #ò rJ   rƒ  )rØ   r  rÆ   z6Callable[[Query, Headers], WebSocketConnection] | Nonerd   rs   re   rt   rf   ru   rg   ru   ra   r   rb   r   rÇ   r„  rq   r›   )rq   zIterator[RealtimeServerEvent]r…  r†  rˆ  r‰  rŠ  r‹  rŒ  rŽ  rC   )rù   rö   re  r�  rq   zMUnion[RealtimeConnection, Callable[[Callable[..., Any]], Callable[..., Any]]])rù   rö   re  rc  rq   r  )rw   rx   ry   rz   r�  r‘  r“   r  rá   rð   r  r  r(  rï   râ   rI  rf  rn  rt  r�  r{   rp   rJ   rG   r  r  ü  sC  ‡ ÙDà$Ó$Ø&Ó&Ø8Ó8Ø.Ó.Ø:Ó:à$Ó$ð KOØ^bØØ"ØØØ!#Ø'+ñKà'ðKð Hð	Kð
 \ðKð ðKð ðKð ðKð ðKð ðKð %ðKð 
õKôBô,ô$ô*ô$ð $(°r÷ 9ô
ôIôVFð EIðØðØ(Aðà	Võô8ð EIðØðØ(Aðà	Võ÷"rJ   r  c                  óè   • \ rS rSrSr\\SSSSSS.                       SS	 jjrSS
 jr S     SS jjrSS jr	 S     SS jjr
SS jr\rSS jrSS jr        SS jrSrg)rl   i&  aè  
Context manager over a `RealtimeConnection` that is returned by `realtime.connect()`

This context manager ensures that the connection will be closed when it exits.

---

Note that if your application doesn't work well with the context manager approach then you
can call the `.enter()` method directly to initiate a connection.

**Warning**: You must remember to close the connection with `.close()`.

```py
connection = client.realtime.connect(...).enter()
# ...
connection.close()
```
NrZ   r[   r\   r]   r“  c               óÂ   • Xl         X l        X0l        S U l        X@l        XPl        X`l        Xpl        X€l        X�l	        X l
        [        US9U l        [        SS9U l        g )Nr•  TrÉ   )Ú"_RealtimeConnectionManager__clientÚ#_RealtimeConnectionManager__call_idÚ!_RealtimeConnectionManager__modelÚ&_RealtimeConnectionManager__connectionÚ'_RealtimeConnectionManager__extra_queryÚ)_RealtimeConnectionManager__extra_headersÚ8_RealtimeConnectionManager__websocket_connection_optionsÚ+_RealtimeConnectionManager__on_reconnectingÚ'_RealtimeConnectionManager__max_retriesÚ)_RealtimeConnectionManager__initial_delayÚ%_RealtimeConnectionManager__max_delayr&   Ú&_RealtimeConnectionManager__send_queuer.   Ú2_RealtimeConnectionManager__event_handler_registryr¤  s               rG   r“   Ú"RealtimeConnectionManager.__init__:  s_   € ð ŒØ ŒØŒØ7;ˆÔØ(ÔØ,ÔØ.JÔ+Ø!0ÔØ(ÔØ,ÔØ$ÔÜ%°Ñ?ˆÔÜ(<ÀdÑ(KˆÕ%rJ   c                ó²   • [        U[        5      (       a  UR                  SSSS9O[        R                  " U5      nU R
                  R                  U5        gr§  )rñ   r   r  r  r  r<  r  r  s      rG   r  ÚRealtimeConnectionManager.sendW  r©  rJ   c                ó^   ^ ^• Ub  T R                   R                  TU5        T $ SUU 4S jjnU$ )zÁRegister an event handler before the connection is established.

Handlers are transferred to the connection on enter. Supports the
same method and decorator forms as ``RealtimeConnection.on``.
c                ó@   >• TR                   R                  TU 5        U $ rC   ©r=  r\  r]  s    €€rG   r_  Ú/RealtimeConnectionManager.on.<locals>.decoratorp  r®  rJ   rb  rC  rd  s   ``  rG   rf  ÚRealtimeConnectionManager.ond  r°  rJ   c                ó<   • U R                   R                  X5        U $ rj  )r=  rl  rm  s      rG   rn  ÚRealtimeConnectionManager.offv  r³  rJ   c                ó\   ^ ^• Ub  T R                   R                  TUSS9  T $ SUU 4S jjnU$ )rµ  Trs  c                ó>   >• TR                   R                  TU SS9  U $ rv  rC  r]  s    €€rG   r_  Ú1RealtimeConnectionManager.once.<locals>.decoratorƒ  r¸  rJ   rb  rC  rd  s   ``  rG   rt  ÚRealtimeConnectionManager.once{  rº  rJ   c                óâ  • U R                  U R                  U R                  5      n[        UU R                  b  U R                   OSU R                  U R
                  U R                  U R                  U R                  U R                  U R                  S9	U l	        U R                  R                  U R                  R                  5        U R                  R                  5         U R                  $ )a)  
If your application doesn't work well with the context manager approach then you
can call this method directly to initiate a connection.

**Warning**: You must remember to close the connection with `.close()`.

```py
connection = client.realtime.connect(...).enter()
# ...
connection.close()
```
NrÅ   )r¼  r5  r6  r  r8  r9  r:  r;  r<  r4  r=  r½  rÖ   rI  r¾  s     rG   Ú	__enter__Ú#RealtimeConnectionManager.__enter__‰  sÈ   € ð ×Ñ˜d×0Ñ0°$×2FÑ2FÓGˆä.ØØ(,×(>Ñ(>Ñ(J�D×$Ò$ÐPTØ ×2Ñ2Ø×*Ñ*Ø×.Ñ.Ø×&Ñ&Ø×*Ñ*Ø×.Ñ.Ø×(Ñ(ñ

ˆÔð 	×%Ñ%×0Ñ0°×1BÑ1B×1ZÑ1ZÔ[Ø×Ñ×+Ñ+Ô-à× Ñ Ð rJ   c                óZ  •  SSK Jn  U R                  R                  5         U R                  R                  nU R                  [        La  0 UESU R                  0En[        U R                  5      (       a<  U R                  nU(       d  [        S5      eU R                  R                  Xa5      u  puObU R                  5       R                  0 U R                  R                  R                  EU R                  [        La  SU R                  0O0 EUES9n[         R#                  S5        U R$                  (       a  [         R#                  S	5        U" ['        U5      4U R                  R(                  [+        0 UEU5      S
.U R$                  D6$ ! [         a  n[        S5      UeS nAff = f)Nr   )rn   rÄ  r_   rÆ  r`   rÇ  rÉ  rÊ  rË  )Úwebsockets.sync.clientrn   rÏ  r$   r1  rÐ  rÑ  r2  r   r   r3  rÓ  rÔ  rÕ  rÖ  rÈ  r?   r  r7  rö   r×  r'   rØ  s           rG   r¼  Ú%RealtimeConnectionManager._connect_ws«  s‰  € ð	dÝ6ð 	�‰×&Ñ&Ô(Ø—}‘}×1Ñ1ˆØ�>‰>¤Ò%ØD˜[ÐD¨)°T·^±^ÑDˆKÜ˜4Ÿ=™=×)Ñ)Ø—L‘LˆEÞÜ!Ð"NÓOÐOà$(§M¡M×$EÑ$EÀeÓ$YÑ!��\à×#Ñ#Ó%×/Ñ/ðØ—m‘m×,Ñ,×3Ñ3ðà26·,±,ÄdÒ2J˜ §¡Ñ.ÐPRðð "ðð 0ð ˆCô 	�	‰	Ð/Ô0Ø×.×.Ü�I‰IÐDÔEáÜ�‹Hð

à"Ÿm™m×6Ñ6Ü.ðØ"ðð ó	 ñ

ð ×1Ñ1ñ

ð 
	
øô3 ó 	dÜÐYÓZÐ`cÐcûð	dús   ‚F Æ
F*ÆF%Æ%F*c                ód  • U R                   R                  b   [        U R                   R                  5      nOMU R                   R                  R                  nUS:X  a  SOSnU R                   R                  R                  US9nUR                  R                  S5      S-   nUR                  US9$ rÜ  )r1  râ  r    rã  rß  rÕ  rá  rä  rå  s        rG   rÔ  Ú&RealtimeConnectionManager._prepare_urlÓ  ré  rJ   c                óT   • U R                   b  U R                   R                  5         g g rC   )r4  r(  rë  s       rG   Ú__exit__Ú"RealtimeConnectionManager.__exit__Þ  s'   € ð ×ÑÑ(Ø×Ñ×#Ñ#Õ%ð )rJ   rð  )rk   r;   r_   rr   r`   rr   ra   r   rb   r   rc   r3   rd   rs   re   rt   rf   ru   rg   ru   rh   rt   rq   r›   rˆ  rC   )rù   rö   re  r�  rq   zTUnion[RealtimeConnectionManager, Callable[[Callable[..., Any]], Callable[..., Any]]])rù   rö   re  rc  rq   rl   )rq   r  )ra   r   rb   r   rq   r  rþ  rÿ  )rw   rx   ry   rz   r�  r   r“   r  rf  rn  rt  rM  r   r¼  rÔ  rU  r{   rp   rJ   rG   rl   rl   &  s=  † ñð. #Ø ð _cØØ"ØØ'ñLð ðLð ð	Lð
 ðLð ðLð ðLð 'AðLð \ðLð ðLð ðLð ðLð ðLð 
õLô:(ð EIðØðØ(Aðà	]õô$ð EIðØðØ(Aðà	]õô!ð@ €Eô&
ôP	;ð&Ø2ð&Ø9Mð&ØWkð&à	÷&rJ   rl   c                  ó   • \ rS rSrSS jrSrg)ÚBaseRealtimeConnectionResourceiå  c                ó   • Xl         g rC   ©rÄ   ©rF   rØ   s     rG   r“   Ú'BaseRealtimeConnectionResource.__init__æ  ó   € Ø%ÕrJ   rZ  N)rØ   r  rq   r›   ©rw   rx   ry   rz   r“   r{   rp   rJ   rG   rX  rX  å  ó   † ÷&rJ   rX  c                  ó&   • \ rS rSr\S.SS jjrSrg)r  iê  ©Úevent_idc               ón   • U R                   R                  [        [        [	        SXS.5      5      5        g©uW  
Send this event to update the sessionâ€™s configuration.
The client may send this event at any time to update any field
except for `voice` and `model`. `voice` can be updated only if there have been no other audio outputs yet.

When the server receives a `session.update`, it will respond
with a `session.updated` event showing the full, effective configuration.
Only the fields that are present in the `session.update` are updated. To clear a field like
`instructions`, pass an empty string. To clear a field like `tools`, pass an empty array.
To clear a field like `turn_detection`, pass `null`.
zsession.update)rì   rº   rb  N©rÄ   r  r   r8   r   ©rF   rº   rb  s      rG   ÚupdateÚRealtimeSessionResource.updateë  s1   € ð 	×Ñ×ÑÜÜ(ÜÐ)9ÀgÑ dÓeóõ	
rJ   rp   N©rº   z"session_update_event_param.Sessionrb  rr   rq   r›   ©rw   rx   ry   rz   r   rg  r{   rp   rJ   rG   r  r  ê  s   † Ø\`÷ 
ò 
rJ   r  c                  ó<   • \ rS rSr\\S.SS jjr\\S.S	S jjrSrg)
r  iÿ  ©rb  r¼   c               ón   • U R                   R                  [        [        [	        SXS.5      5      5        g©a7  
This event instructs the server to create a Response, which means triggering
model inference. When in Server VAD mode, the server will create Responses
automatically.

A Response will include at least one Item, and may have two, in which case
the second will be a function call. These Items will be appended to the
conversation history by default.

The server will respond with a `response.created` event, events for Items
and content created, and finally a `response.done` event to indicate the
Response is complete.

The `response.create` event includes inference configuration like
`instructions` and `tools`. If these are set, they will override the Session's
configuration for this Response only.

Responses can be created out-of-band of the default Conversation, meaning that they can
have arbitrary input, and it's possible to disable writing the output to the Conversation.
Only one Response can write to the default Conversation at a time, but otherwise multiple
Responses can be created in parallel. The `metadata` field is a good way to disambiguate
multiple simultaneous Responses.

Clients can set `conversation` to `none` to create a Response that does not write to the default
Conversation. Arbitrary input can be provided with the `input` field, which is an array accepting
raw Items and references to existing Items.
zresponse.create)rì   rb  r¼   Nre  ©rF   rb  r¼   s      rG   ÚcreateÚRealtimeResponseResource.create   s1   € ð8 	×Ñ×ÑÜÜ(ÜÐ):ÈÑ gÓhóõ	
rJ   ©rb  Úresponse_idc               ón   • U R                   R                  [        [        [	        SXS.5      5      5        g©ag  Send this event to cancel an in-progress response.

The server will respond
with a `response.done` event with a status of `response.status=cancelled`. If
there is no response to cancel, the server will respond with an error. It's safe
to call `response.cancel` even if no response is in progress, an error will be
returned the session will remain unaffected.
zresponse.cancel)rì   rb  rs  Nre  ©rF   rb  rs  s      rG   ÚcancelÚRealtimeResponseResource.cancel#  s1   € ð 	×Ñ×ÑÜÜ(ÜÐ):ÈÑ mÓnóõ	
rJ   rp   N©rb  rr   r¼   z(RealtimeResponseCreateParamsParam | Omitrq   r›   ©rb  rr   rs  rr   rq   r›   ©rw   rx   ry   rz   r   rp  rw  r{   rp   rJ   rG   r  r  ÿ  s   † Ø/3Ðjn÷ !
ðF 04Èt÷ 
ò 
rJ   r  c                  óJ   • \ rS rSr\S.SS jjr\S.SS jjr\S.S	S jjrSrg)
r  i4  ra  c          
     ón   • U R                   R                  [        [        [	        SUS.5      5      5        g©z}Send this event to clear the audio bytes in the buffer.

The server will
respond with an `input_audio_buffer.cleared` event.
zinput_audio_buffer.clear©rì   rb  Nre  ©rF   rb  s     rG   ÚclearÚ&RealtimeInputAudioBufferResource.clear5  s/   € ð 	×Ñ×ÑÜÔ)¬?ÐD^ÐltÑ;uÓ+vÓwõ	
rJ   c          
     ón   • U R                   R                  [        [        [	        SUS.5      5      5        g©a(  
Send this event to commit the user input audio buffer, which will create a  new user message item in the conversation. This event will produce an error  if the input audio buffer is empty. When in Server VAD mode, the client does  not need to send this event, the server will commit the audio buffer  automatically.

Committing the input audio buffer will trigger input audio transcription  (if enabled in session configuration), but it will not create a response  from the model. The server will respond with an `input_audio_buffer.committed` event.
zinput_audio_buffer.commitr  Nre  r€  s     rG   ÚcommitÚ'RealtimeInputAudioBufferResource.commit?  s/   € ð 	×Ñ×ÑÜÔ)¬?ÐD_ÐmuÑ;vÓ+wÓxõ	
rJ   c               ón   • U R                   R                  [        [        [	        SXS.5      5      5        g©af  Send this event to append audio bytes to the input audio buffer.

The audio
buffer is temporary storage you can write to and later commit. A "commit" will create a new
user message item in the conversation history from the buffer content and clear the buffer.
Input audio transcription (if enabled) will be generated when the buffer is committed.

If VAD is enabled the audio buffer is used to detect speech and the server will decide
when to commit. When Server VAD is disabled, you must commit the audio buffer
manually. Input audio noise reduction operates on writes to the audio buffer.

The client may choose how much audio to place in each event up to a maximum
of 15 MiB, for example streaming smaller chunks from the client may allow the
VAD to be more responsive. Unlike most other client events, the server will
not send a confirmation response to this event.
zinput_audio_buffer.append)rì   Úaudiorb  Nre  ©rF   r‰  rb  s      rG   ÚappendÚ'RealtimeInputAudioBufferResource.appendI  s1   € ð" 	×Ñ×ÑÜÜ(ÜÐ)DÈuÑ kÓlóõ	
rJ   rp   N©rb  rr   rq   r›   ©r‰  rö   rb  rr   rq   r›   ©	rw   rx   ry   rz   r   r�  r…  r‹  r{   rp   rJ   rG   r  r  4  s$   † Ø.2÷ 
ð 04÷ 
ð <@÷ 
ò 
rJ   r  c                  ó(   • \ rS rSr\SS j5       rSrg)r  ib  c                ó,   • [        U R                  5      $ rC   )Ú RealtimeConversationItemResourcerÄ   rE   s    rG   ÚitemÚ!RealtimeConversationResource.itemc  s   € ä/°×0@Ñ0@ÓAÐArJ   rp   N)rq   r’  ©rw   rx   ry   rz   r   r“  r{   rp   rJ   rG   r  r  b  s   † ØóBó óBrJ   r  c                  ól   • \ rS rSr\S.S
S jjr\\S.       SS jjr\S.SS jjr\S.S
S jjrSr	g	)r’  ih  ra  c               ón   • U R                   R                  [        [        [	        SXS.5      5      5        g©a  Send this event when you want to remove any item from the conversation
history.

The server will respond with a `conversation.item.deleted` event,
unless the item does not exist in the conversation history, in which case the
server will respond with an error.
zconversation.item.delete©rì   Úitem_idrb  Nre  ©rF   rš  rb  s      rG   ÚdeleteÚ'RealtimeConversationItemResource.deletei  s2   € ð 	×Ñ×ÑÜÜ(ÜÐ)CÐPWÑ nÓoóõ	
rJ   ©rb  Úprevious_item_idc               ór   • U R                   R                  [        [        [	        SUUUS.5      5      5        g©a¥  
Add a new Item to the Conversation's context, including messages, function
calls, and function call responses. This event can be used both to populate a
"history" of the conversation and to add new items mid-stream, but has the
current limitation that it cannot populate assistant audio messages.

If successful, the server will respond with a `conversation.item.created`
event, otherwise an `error` event will be sent.
zconversation.item.create)rì   r“  rb  rŸ  Nre  ©rF   r“  rb  rŸ  s       rG   rp  Ú'RealtimeConversationItemResource.createx  s<   € ð 	×Ñ×ÑÜÜ(Üà :Ø $Ø$,Ø,<ñ	óó
õ	
rJ   c               ót   • U R                   R                  [        [        [	        SUUUUS.5      5      5        g©u4  Send this event to truncate a previous assistant messageâ€™s audio.

The server
will produce audio faster than realtime, so this event is useful when the user
interrupts to truncate audio that has already been sent to the client but not
yet played. This will synchronize the server's understanding of the audio with
the client's playback.

Truncating audio will delete the server-side text transcript to ensure there
is not text in the context that hasn't been heard by the user.

If successful, the server will respond with a `conversation.item.truncated`
event.
zconversation.item.truncate)rì   Úaudio_end_msÚcontent_indexrš  rb  Nre  ©rF   r¦  r§  rš  rb  s        rG   ÚtruncateÚ)RealtimeConversationItemResource.truncate’  s?   € ð 	×Ñ×ÑÜÜ(Üà <Ø(4Ø)6Ø#*Ø$,ñóóõ	
rJ   c               ón   • U R                   R                  [        [        [	        SXS.5      5      5        g©a�  
Send this event when you want to retrieve the server's representation of a specific item in the conversation history. This is useful, for example, to inspect user audio after noise cancellation and VAD.
The server will respond with a `conversation.item.retrieved` event,
unless the item does not exist in the conversation history, in which case the
server will respond with an error.
zconversation.item.retriever™  Nre  r›  s      rG   ÚretrieveÚ)RealtimeConversationItemResource.retrieve°  s2   € ð 	×Ñ×ÑÜÜ(ÜÐ)EÐRYÑ pÓqóõ	
rJ   rp   N©rš  rö   rb  rr   rq   r›   ©r“  r7   rb  rr   rŸ  rr   rq   r›   ©
r¦  rt   r§  rt   rš  rö   rb  rr   rq   r›   ©
rw   rx   ry   rz   r   rœ  rp  r©  r­  r{   rp   rJ   rG   r’  r’  h  sV   † Ø=A÷ 
ð  FJÐjnñ
Ø,ð
Ø8Bð
Ø]gð
à	õ
ð4 gk÷ 
ð< @D÷ 
ò 
rJ   r’  c                  ó&   • \ rS rSr\S.SS jjrSrg)r  i¿  ra  c          
     ón   • U R                   R                  [        [        [	        SUS.5      5      5        g©a•  **WebRTC/SIP Only:** Emit to cut off the current audio response.

This will trigger the server to
stop generating audio and emit a `output_audio_buffer.cleared` event. This
event should be preceded by a `response.cancel` client event to stop the
generation of the current response.
[Learn more](https://platform.openai.com/docs/guides/realtime-conversations#client-and-server-events-for-audio-in-webrtc).
zoutput_audio_buffer.clearr  Nre  r€  s     rG   r�  Ú'RealtimeOutputAudioBufferResource.clearÀ  s/   € ð 	×Ñ×ÑÜÔ)¬?ÐD_ÐmuÑ;vÓ+wÓxõ	
rJ   rp   Nr�  ©rw   rx   ry   rz   r   r�  r{   rp   rJ   rG   r  r  ¿  s   † Ø.2÷ 
ò 
rJ   r  c                  ó   • \ rS rSrSS jrSrg)Ú#BaseAsyncRealtimeConnectionResourceiÎ  c                ó   • Xl         g rC   rZ  r[  s     rG   r“   Ú,BaseAsyncRealtimeConnectionResource.__init__Ï  r]  rJ   rZ  N)rØ   r·   rq   r›   r^  rp   rJ   rG   r¹  r¹  Î  r_  rJ   r¹  c                  ó&   • \ rS rSr\S.SS jjrSrg)r¹   iÓ  ra  c             ƒ  óŠ   #   • U R                   R                  [        [        [	        SXS.5      5      5      I Sh  v•N   g N7frd  re  rf  s      rG   rg  Ú#AsyncRealtimeSessionResource.updateÔ  s>   é € ð ×Ñ×#Ñ#ÜÜ(ÜÐ)9ÀgÑ dÓeóó
÷ 	
ó 	
ùó   ‚9A»A¼Arp   Nri  rj  rp   rJ   rG   r¹   r¹   Ó  s   † Øbf÷ 
ò 
rJ   r¹   c                  óF   • \ rS rSr\\S.     SS jjr\\S.S	S jjrSrg)
r»   iè  rl  c             ƒ  óŠ   #   • U R                   R                  [        [        [	        SXS.5      5      5      I Sh  v•N   g N7frn  re  ro  s      rG   rp  Ú$AsyncRealtimeResponseResource.createé  s>   é € ð< ×Ñ×#Ñ#ÜÜ(ÜÐ):ÈÑ gÓhóó
÷ 	
ó 	
ùr¿  rr  c             ƒ  óŠ   #   • U R                   R                  [        [        [	        SXS.5      5      5      I Sh  v•N   g N7fru  re  rv  s      rG   rw  Ú$AsyncRealtimeResponseResource.cancel  s>   é € ð ×Ñ×#Ñ#ÜÜ(ÜÐ):ÈÑ mÓnóó
÷ 	
ó 	
ùr¿  rp   Nry  rz  r{  rp   rJ   rG   r»   r»   è  s8   † à(,Ðcgñ#
Ø%ð#
Ø8`ð#
à	õ#
ðJ 6:ÐUY÷ 
ò 
rJ   r»   c                  óJ   • \ rS rSr\S.SS jjr\S.SS jjr\S.S	S jjrSrg)
r½   i  ra  c          
   ƒ  óŠ   #   • U R                   R                  [        [        [	        SUS.5      5      5      I Sh  v•N   g N7fr~  re  r€  s     rG   r�  Ú+AsyncRealtimeInputAudioBufferResource.clear   s<   é € ð ×Ñ×#Ñ#ÜÔ)¬?ÐD^ÐltÑ;uÓ+vÓwó
÷ 	
ó 	
ùr¿  c          
   ƒ  óŠ   #   • U R                   R                  [        [        [	        SUS.5      5      5      I Sh  v•N   g N7fr„  re  r€  s     rG   r…  Ú,AsyncRealtimeInputAudioBufferResource.commit*  s<   é € ð ×Ñ×#Ñ#ÜÔ)¬?ÐD_ÐmuÑ;vÓ+wÓxó
÷ 	
ó 	
ùr¿  c             ƒ  óŠ   #   • U R                   R                  [        [        [	        SXS.5      5      5      I Sh  v•N   g N7frˆ  re  rŠ  s      rG   r‹  Ú,AsyncRealtimeInputAudioBufferResource.append4  s>   é € ð" ×Ñ×#Ñ#ÜÜ(ÜÐ)DÈuÑ kÓlóó
÷ 	
ó 	
ùr¿  rp   Nr�  rŽ  r�  rp   rJ   rG   r½   r½     s%   † Ø48÷ 
ð 6:÷ 
ð BF÷ 
ò 
rJ   r½   c                  ó(   • \ rS rSr\SS j5       rSrg)r¿   iM  c                ó,   • [        U R                  5      $ rC   )Ú%AsyncRealtimeConversationItemResourcerÄ   rE   s    rG   r“  Ú&AsyncRealtimeConversationResource.itemN  s   € ä4°T×5EÑ5EÓFÐFrJ   rp   N)rq   rÎ  r•  rp   rJ   rG   r¿   r¿   M  s   † ØóGó óGrJ   r¿   c                  ó~   • \ rS rSr\S.S
S jjr\\S.       SS jjr\S.         SS jjr\S.S
S jjrSr	g	)rÎ  iS  ra  c             ƒ  óŠ   #   • U R                   R                  [        [        [	        SXS.5      5      5      I Sh  v•N   g N7fr˜  re  r›  s      rG   rœ  Ú,AsyncRealtimeConversationItemResource.deleteT  s?   é € ð ×Ñ×#Ñ#ÜÜ(ÜÐ)CÐPWÑ nÓoóó
÷ 	
ó 	
ùr¿  rž  c             ƒ  óŽ   #   • U R                   R                  [        [        [	        SUUUS.5      5      5      I Sh  v•N   g N7fr¡  re  r¢  s       rG   rp  Ú,AsyncRealtimeConversationItemResource.createc  sI   é € ð ×Ñ×#Ñ#ÜÜ(Üà :Ø $Ø$,Ø,<ñ	óó
ó
÷ 	
ó 	
ùs   ‚;A½A¾Ac             ƒ  ó�   #   • U R                   R                  [        [        [	        SUUUUS.5      5      5      I Sh  v•N   g N7fr¥  re  r¨  s        rG   r©  Ú.AsyncRealtimeConversationItemResource.truncate}  sL   é € ð" ×Ñ×#Ñ#ÜÜ(Üà <Ø(4Ø)6Ø#*Ø$,ñóóó
÷ 	
ó 	
ùs   ‚<A¾A¿Ac             ƒ  óŠ   #   • U R                   R                  [        [        [	        SXS.5      5      5      I Sh  v•N   g N7fr¬  re  r›  s      rG   r­  Ú.AsyncRealtimeConversationItemResource.retrieve�  s?   é € ð ×Ñ×#Ñ#ÜÜ(ÜÐ)EÐRYÑ pÓqóó
÷ 	
ó 	
ùr¿  rp   Nr¯  r°  r±  r²  rp   rJ   rG   rÎ  rÎ  S  s   † ØCG÷ 
ð  FJÐjnñ
Ø,ð
Ø8Bð
Ø]gð
à	õ
ð6 ^bñ
Ø"ð
Ø36ð
ØADð
ØPZð
à	õ
ð@ FJ÷ 
ò 
rJ   rÎ  c                  ó&   • \ rS rSr\S.SS jjrSrg)rÁ   i¬  ra  c          
   ƒ  óŠ   #   • U R                   R                  [        [        [	        SUS.5      5      5      I Sh  v•N   g N7frµ  re  r€  s     rG   r�  Ú,AsyncRealtimeOutputAudioBufferResource.clear­  s<   é € ð ×Ñ×#Ñ#ÜÔ)¬?ÐD_ÐmuÑ;vÓ+wÓxó
÷ 	
ó 	
ùr¿  rp   Nr�  r·  rp   rJ   rG   rÁ   rÁ   ¬  s   † Ø48÷ 
ò 
rJ   rÁ   )yÚ
__future__r   r  r  rF  ÚloggingÚtypesr   Útypingr   r   r   r   r	   r
   r   Útyping_extensionsr   Úhttpx2Úpydanticr   rN   r   r   r   r   r   r   Ú_typesr   r   r   r   Ú_utilsr   r   r   r   r   Ú_compatr   Ú_httpx2r    Ú_modelsr!   Ú	_resourcer"   r#   Ú_exceptionsr$   r%   rÕ   r&   Ú_base_clientr'   rH   r(   r)   r*   r+   r,   r-   Ú_event_handlerr.   Útypes.realtimer/   Útypes.websocket_reconnectionr0   r1   r2   Ú"types.websocket_connection_optionsr3   Ú#types.realtime.realtime_error_eventr4   Ú$types.realtime.realtime_client_eventr5   Ú$types.realtime.realtime_server_eventr6   Ú&types.realtime.conversation_item_paramr7   Ú*types.realtime.realtime_client_event_paramr8   Ú4types.realtime.realtime_response_create_params_paramr9   rP  r:   r  Úwebsockets.asyncio.clientrÃ   rD   r;   r<   Ú__all__Ú	getLoggerrw   r?   r‘  r=   r>   rR   r„   rW   r‡   r·   rŠ   r  rl   rX  r  r  r  r  r’  r  r¹  r¹   r»   r½   r¿   rÎ  rÁ   rp   rJ   rG   Ú<module>rø     só  ðö #ã Û Û Û Ý ß Q× QÑ QÝ +ã Ý ÷÷ ÷ 1Ó 0÷õ õ 'Ý *Ý /ß :ß FÝ $Ý +÷÷ õ 3Ý 8ß jÑ jÝ LÝ EÝ GÝ GÝ KÝ RÝ eæÝNÝVç.à�Ð
'€à×'Ò'¨Ó1€€^Ó 1ôC
ˆô C
ôLC
Ð$ô C
÷L
:ñ 
:÷
?ñ 
?÷
@ñ 
@÷
Eñ 
E÷s!ñ s!÷l	~,ñ ~,÷Bgñ g÷T	|&ñ |&÷~&ñ &ô

Ð<ô 
ô*2
Ð=ô 2
ôj+
Ð'Eô +
ô\BÐ#Aô BôT
Ð'Eô T
ôn
Ð(Fô 
÷&ñ &ô

Ð#Fô 
ô*4
Ð$Gô 4
ôn+
Ð,Oô +
ô\GÐ(Kô GôV
Ð,Oô V
ôr
Ð-Põ 
rJ   