Ë
    Fü´j÷Ú  ã                  óÈ  — U d dl mZ d dlZd dlZd dl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 d dlZd dlmZ ddlmZmZmZmZ dd	lmZmZmZmZm Z  dd
l!m"Z" ddl#m$Z$m%Z% ddl&m'Z'm(Z( ddl)m*Z*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9m:Z:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZA ddlBmCZC ddlDmEZE e	rd dlFmGZH d dlImGZJ ddlKmLZLmMZM ddgZN ejž                  eP«      ZQdeRd<    G d „ de'«      ZS G d!„ de(«      ZT G d"„ d#«      ZU G d$„ d%«      ZV G d&„ d'«      ZW G d(„ d)«      ZX G d*„ d+«      ZY G d,„ d-eY«      ZZ G d.„ d/eY«      Z[ G d0„ d1eY«      Z\ G d2„ d3eY«      Z] G d4„ d5eY«      Z^ G d6„ d7eY«      Z_ G d8„ d9eY«      Z` G d:„ d;«      Za G d<„ d=ea«      Zb G d>„ d?ea«      Zc G d@„ dAea«      Zd G dB„ dCea«      Ze G dD„ dEea«      Zf G dF„ dGea«      Zg G dH„ dIea«      Zhy)Jé    )ÚannotationsN)ÚTracebackType)ÚTYPE_CHECKINGÚAnyÚUnionÚCallableÚIteratorÚOptionalÚ	AwaitableÚcast)ÚAsyncIterator)Ú	BaseModelé   )ÚOmitÚQueryÚHeadersÚomit)Úis_givenÚpath_templateÚmaybe_transformÚstrip_not_givenÚasync_maybe_transform)Úcached_property)ÚFinalRequestOptionsÚconstruct_type_unchecked)ÚSyncAPIResourceÚAsyncAPIResource)ÚOpenAIErrorÚWebSocketConnectionClosedError)Ú	SendQueue)Ú_merge_mappings)ÚEventHandlerRegistry)Ú
ErrorEvent)ÚForkClientEvent)ÚForkServerEvent)ÚReconnectingEventÚReconnectingOverridesÚis_recoverable_close)ÚForkClientEventParam)ÚWebSocketConnectionOptions)ÚForkSessionConfigParam)ÚSessionUpdateConfigParam)ÚResponseInputItemParam)ÚClientConnection)ÚOpenAIÚAsyncOpenAIÚForksÚ
AsyncForkszlogging.LoggerÚlogc            	      óN   — e Zd Zi i i ddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)	r1   Né   ç      à?ç       @é   ©Úextra_queryÚextra_headersÚwebsocket_connection_optionsÚon_reconnectingÚmax_retriesÚinitial_delayÚ	max_delayÚmax_queue_sizec       	        ó@   — t        | j                  ||||||||	|¬«
      S ©zµFork a stored Live session over WebSocket.

        Send session.start with an overrides object (which may be empty), then wait for session.started. The model is inherited.
        )
Úclientr:   r;   r<   r=   r>   r?   r@   rA   Ú
session_id)ÚForksConnectionManagerÚ_client©
ÚselfrE   r:   r;   r<   r=   r>   r?   r@   rA   s
             úY/root/workspace/ytshorts/venv/lib/python3.12/site-packages/openai/resources/live/forks.pyÚconnectzForks.connect/   s3   € ô" &Ø—<‘<Ø#Ø'Ø)EØ+Ø#Ø'ØØ)Ø!ô
ð 	
ó    )rE   Ústrr:   r   r;   r   r<   r*   r=   úBCallable[[ReconnectingEvent], ReconnectingOverrides | None] | Noner>   Úintr?   Úfloatr@   rP   rA   rO   ÚreturnrF   ©Ú__name__Ú
__module__Ú__qualname__rK   © rL   rJ   r1   r1   .   s‡   „ ð
  Ø!#ØCEØ^bØØ"ØØ'ñ
ð ð
ð ð	
ð
 ð
ð 'Að
ð \ð
ð ð
ð ð
ð ð
ð ð
ð 
 ô
rL   c            	      óN   — e Zd Zi i i ddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)	r2   Nr5   r6   r7   r8   r9   c       	        ó@   — t        | j                  ||||||||	|¬«
      S rC   )ÚAsyncForksConnectionManagerrG   rH   s
             rJ   rK   zAsyncForks.connectO   s3   € ô" +Ø—<‘<Ø#Ø'Ø)EØ+Ø#Ø'ØØ)Ø!ô
ð 	
rL   )rE   rM   r:   r   r;   r   r<   r*   r=   rN   r>   rO   r?   rP   r@   rP   rA   rO   rQ   rY   rR   rV   rL   rJ   r2   r2   N   s‡   „ ð
  Ø!#ØCEØ^bØØ"ØØ'ñ
ð ð
ð ð	
ð
 ð
ð 'Að
ð \ð
ð ð
ð ð
ð ð
ð ð
ð 
%ô
rL   c            	      óþ   — e Zd ZU dZded<   ded<   ded<   ddd	d
di i ddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdd„Zd d„Zd!d„Zd"d„Z	d#d„Z
dddœd$d„Zd%d„Zd&d„Zd'd„Z	 d(	 	 	 	 	 d)d„Zd*d„Z	 d(	 	 	 	 	 d)d„Zd'd„Zy)+ÚAsyncForksConnectionú7Represents a live WebSocket connection to the Forks APIÚAsyncForksSessionResourceÚsessionÚAsyncForksResponseResourceÚresponseÚAsyncWebSocketConnectionÚ_connectionNr5   r6   r7   ©Úmake_wsr=   r>   r?   r@   r:   r;   Ú
send_queuec               ó&  — || _         || _        || _        || _        d| _        || _        || _        || _        || _        d| _	        d| _
        |	xs
 t        «       | _        t        d¬«      | _        t        | «      | _        t#        | «      | _        y )Nr   F©Úuse_lock)rb   Ú_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`   ©
rI   Ú
connectionrd   r=   r>   r?   r@   r:   r;   re   s
             rJ   Ú__init__zAsyncForksConnection.__init__v   sŽ   € ð &ˆÔØˆŒØ /ˆÔØ'ˆÔØ"#ˆÔØ+ˆÔØ#ˆŒØ'ˆÔØ+ˆÔØ%*ˆÔ"Ø %ˆÔØ%Ò4¬«ˆÔÜ';ÀUÔ'KˆÔ$ä0°Ó6ˆŒÜ2°4Ó8ˆ�rL   c               ó  K  — ddl m}m} 	 	 | j                  «       ƒ d{  –—† ­–— Œ7 Œ# |$ r Y y|$ rO}| j	                  |«      ƒ d{  –—†7  s+| j
                  j                  «       }|rt        d|¬«      |‚‚ Y d}~ŒXd}~ww xY w­w©zq
        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.exceptionsrz   r{   ÚrecvÚ
_reconnectrs   Údrainr   ©rI   rz   r{   ÚexcÚunsents        rJ   Ú	__aiter__zAsyncForksConnection.__aiter__”   s�   è ø€ ÷
 	TàðØ ŸI™I›K×'Ó'ð à'ùØ%ò ÙØ(ò Ø!Ÿ_™_¨SÓ1×1Ñ1Ø!×-Ñ-×3Ñ3Ó5�FÙÜ<ØNØ,2ôð  #ð#ð ô 2ûðüsL   ‚
B�+  )¡+ ¨B©+ «B°B²B¶B Á
AÁ0B Á;BÂ BÂBc              ƒ  ó(  K  — | j                  | j                  «       ƒ d{  –—† «      }t        t        t        |«      t
        «      rt        d|«      j                  d«      nt        |dd«      }t        |t        «      r|r|dk7  rd| _	        |S 7 Œn­w)úµ
        Receive the next message from the connection and parses it into a `ForkServerEvent` 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ÚgetattrrM   rl   ©rI   ÚeventÚ
event_types      rJ   r   zAsyncForksConnection.recvª   s…   è ø€ ð × Ñ  t§¡Ó'8×!8Ó9ˆô œ$œv uÓ-¬tÔ4ô Ð$ eÓ,×0Ñ0°Ô8ä˜ ¨Ó-ð 	ô �j¤#Ô&©:¸*ÈÒ:OØ&'ˆDÔ#Øˆð "9ús   ‚B¡B¢A/Bc              ƒ  ó   K  — | j                   j                  d¬«      ƒ d{  –—† }t        j                  dt	        |«      «       | j
                  ra	 t        j                  |«      }t        |t        «      rt        d|«      j                  d«      nd}t        |t        «      r|r|dk7  rd| _        |S 7 Œ’# t        t        f$ r |cY S w xY w­w)	á  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 `ForkServerEvent` object like `.recv()` does,
        then you can call `.parse_event(data)`.
        F©ÚdecodeNú$Received WebSocket message: %i bytesrˆ   r‰   rŠ   r   ©rb   r   r3   ÚdebugÚlenrl   ÚjsonÚloadsÚ
ValueErrorÚRecursionErrorrŽ   r�   r   r‘   rM   ©rI   ÚmessageÚ
event_datar•   s       rJ   r�   zAsyncForksConnection.recv_bytes¼   s¼   è ø€ ð ×(Ñ(×-Ñ-°UÐ-Ó;×;ˆÜ�	‰	Ð8¼#¸g»,ÔGØ×"Ò"ðÜ%)§Z¡Z°Ó%8�
ô OYÐYcÔeiÔNjœÐ1°:Ó>×BÑBÀ6ÔJÐptˆJÜ˜*¤cÔ*©z¸jÈGÒ>SØ*+�Ô'Øˆð <ùô ¤Ð/ò Ø’ðüs4   ‚ C¢B5£/CÁB7 Á(ACÂ7CÃCÃ
CÃCc              ƒ  óœ  K  — t        |t        «      r|j                  ddd¬«      n*t        j                  t        |t        «      ƒ d {  –—† «      }| j                  r| j                  j                  |«       y 	 | j                  j                  |«      ƒ d {  –—†  y 7 ŒU7 Œ# t        $ r | j                  j                  |«       ‚ w xY w­w©NT©Úuse_api_namesÚexclude_defaultsÚexclude_unset)rŽ   r   Úto_jsonrž   Údumpsr   r)   rr   rs   Úenqueuerb   ÚsendÚ	Exception©rI   r”   Údatas      rJ   r®   zAsyncForksConnection.sendÑ   s¶   è ø€ ô ˜%¤Ô+ð �M‰M¨¸tÐSWˆMÔXä—‘Ô"7¸Ô?SÓ"T×TÓUð 	ð
 × Ò Ø×Ñ×$Ñ$ TÔ*Øð	Ø×"Ñ"×'Ñ'¨Ó-×-Ñ-ð Uøð .ùÜò 	Ø×Ñ×$Ñ$ TÔ*Øð	üs<   ‚ACÁ	BÁ
0CÁ;B# ÂB!ÂB# ÂCÂ!B# Â#&C	Ã	Cc              ƒ  óì   K  — | j                   r?t        |t        «      r|n|j                  d«      }| j                  j                  |«       y | j                  j                  |«      ƒ d {  –—†  y 7 Œ­w©Núutf-8©rr   rŽ   rM   r™   rs   r­   rb   r®   ©rI   r±   Úraws      rJ   Úsend_rawzAsyncForksConnection.send_rawà   sY   è ø€ Ø× Ò Ü$ T¬3Ô/‘$°T·[±[ÀÓ5IˆCØ×Ñ×$Ñ$ SÔ)ØØ×Ñ×#Ñ# DÓ)×)Ò)ús   ‚A*A4Á,A2Á-A4éè  Ú ©ÚcodeÚreasonc             ƒ  óh   K  — d| _         | j                  j                  ||¬«      ƒ d {  –—†  y 7 Œ­w©NTr»   ©rq   rb   Úclose©rI   r¼   r½   s      rJ   rÁ   zAsyncForksConnection.closeç   s-   è ø€ Ø%)ˆÔ"Ø×Ñ×$Ñ$¨$°vÐ$Ó>×>Ò>ús   ‚(2ª0«2c           
     ó‚   — t        t        t        t        j                  |«      t        t
        t        «      ¬«      «      S ©z”
        Converts a raw `str` or `bytes` message into a `ForkServerEvent` object.

        This is helpful if you're using `.recv_bytes()`.
        )ÚvalueÚtype_©r   r%   r   rž   rŸ   r   ©rI   r±   s     rJ   rŒ   z AsyncForksConnection.parse_eventë   ó,   € ô ”OÔ%=ÄDÇJÁJÈtÓDTÔ\`ÔadÔfuÓ\vÔ%wÓxÐxrL   c           	   ƒ  óž  K  — ddl }| j                  �| j                  €yddlm} d}t        ||«      r"|j                  �|j                  j                  }t        |«      syd| _	        t        | j                  dz   | j                  dz   «      D �]…  }|| _        t        | j                  d|dz
  z  z  | j                  «      }d	t!        j                   «       d
z  z   }||z  }t#        || j                  ||| j$                  | j&                  ¬«      }		 | j                  |	«      }
|
�|
j+                  d«      r	d| _	         y|
�d|
v r
|
d   | _        d|
v r
|
d   | _        t,        j/                  d|| j                  |«       |j1                  |«      ƒ d{  –—†  | j2                  r	d| _	         y	 | j                  | j$                  | j&                  «      ƒ d{  –—† | _        t,        j/                  d«       d| _	        | j7                  «       ƒ d{  –—†   y d| _	        y# t(        $ r d| _	        Y  yw xY w7 Œ£7 Œa7 Œ*# t(        $ r Y �Œºw xY w­w)úÀ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{   éî  Té   é   ç      è?ç      Ð?©ÚattemptÚmax_attemptsÚdelayÚ
close_coder:   r;   Úabortr:   r;   ú?Reconnecting to WebSocket API (attempt %d/%d) after %.1fs delayúReconnected to WebSocket API)Úasynciorj   ri   r~   r{   rŽ   Úrcvdr¼   r(   rr   Úrangerl   rk   Úminrm   rn   Úrandomr&   ro   rp   r¯   r‘   r3   ÚinfoÚsleeprq   rb   Ú_flush_send_queue)rI   rƒ   rÚ   r{   rÖ   rÓ   Ú
base_delayÚjitterrÕ   r”   Úresults              rJ   r€   zAsyncForksConnection._reconnectó   sM  è ø€ ó 	à× Ñ Ð(¨D¯M©MÐ,AØå?àˆ
Ü�cÐ0Ô1°c·h±hÐ6JØŸ™Ÿ™ˆJä# JÔ/Øà $ˆÔä˜T×4Ñ4°qÑ8¸$×:KÑ:KÈaÑ:OÓPó 2	ˆGØ&-ˆDÔ#Ü˜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Ø(-�Ô%ÙàÐ!Ø  FÑ*Ø(.¨}Ñ(=�DÔ%Ø" fÑ,Ø*0°Ñ*A�DÔ'ä�H‰HØQØØ×!Ñ!Øô	ð —-‘- Ó&×&Ð&à×)Ò)Ø(-�Ô%ÙðØ)-¯©°t×7HÑ7HÈ$×J]ÑJ]Ó)^×#^�Ô Ü—‘Ð7Ô8Ø(-�Ô%Ø×,Ñ,Ó.×.Ð.Ùða2	ðh !&ˆÔØøôI ò Ø(-�Ô%Úðúð( 'øð $_øð /ùäò Úðüs   ‚DIÄH Ä#A0IÆH7ÆIÆ.)H=ÇH9Ç8H=ÈH;ÈH=ÈIÈ H4È0IÈ3H4È4IÈ9H=È;H=È=	I
ÉIÉ	I
É
Ic              ƒ  ó®   ‡ K  — dˆ fd„}	 ‰ j                   j                  |«      ƒ d{  –—†  y7 Œ# t        $ r t        j	                  d«       Y yw xY w­w)ú5Send all queued messages over the current connection.c              “  óX   •K  — ‰j                   j                  | «      ƒ d {  –—†  y 7 Œ­w©N©rb   r®   ©r±   rI   s    €rJ   Ú_sendz5AsyncForksConnection._flush_send_queue.<locals>._sendC  s!   øè ø€ Ø×"Ñ"×'Ñ'¨Ó-×-Ò-ús   ƒ*¢(£*Nú*Failed to flush send queue after reconnect)r±   rM   rQ   ÚNone)rs   Úflush_asyncr¯   r3   Úwarning)rI   rë   s   ` rJ   rá   z&AsyncForksConnection._flush_send_queue@  sI   øè ø€ õ	.ð	FØ×"Ñ"×.Ñ.¨uÓ5×5Ò5ùÜò 	FÜ�K‰KÐDÖEð	Füs1   ƒA‹1 ©/ª1 ®A¯1 ±AÁAÁAÁAc                óX   ‡ ‡— |�‰ j                   j                  ‰|«       ‰ S dˆˆ fd„}|S )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("session.started", my_handler)

        Or as a decorator::

            @connection.on("session.started")
            async def my_handler(event): ...
        c                ó@   •— ‰j                   j                  ‰| «       | S rè   ©rt   Úadd©Úfnr•   rI   s    €€rJ   Ú	decoratorz*AsyncForksConnection.on.<locals>.decoratora  ó   ø€ Ø×(Ñ(×,Ñ,¨Z¸Ô<ØˆIrL   ©rõ   úCallable[..., Any]rQ   rù   rò   ©rI   r•   Úhandlerrö   s   ``  rJ   ÚonzAsyncForksConnection.onK  ó3   ù€ ð$ ÐØ×(Ñ(×,Ñ,¨Z¸ÔAØˆKö	ð ÐrL   c                ó>   — | j                   j                  ||«       | S ©z-Remove a previously registered event handler.©rt   Úremove©rI   r•   rû   s      rJ   ÚoffzAsyncForksConnection.offg  ó   € à×$Ñ$×+Ñ+¨J¸Ô@ØˆrL   c                ó\   ‡ ‡— |� ‰ j                   j                  ‰|d¬«       ‰ S dˆˆ fd„}|S )úbRegister a one-time event handler.

        Automatically removed after first invocation.
        T©Úoncec                óD   •— ‰j                   j                  ‰| d¬«       | S ©NTr  rò   rô   s    €€rJ   rö   z,AsyncForksConnection.once.<locals>.decoratorw  ó#   ø€ Ø×(Ñ(×,Ñ,¨Z¸À$Ð,ÔGØˆIrL   rø   rò   rú   s   ``  rJ   r  zAsyncForksConnection.oncel  ó8   ù€ ð ÐØ×(Ñ(×,Ñ,¨Z¸ÀtÐ,ÔLØˆKö	ð ÐrL   c              ƒ  ó¸  K  — ddl }| 2 3 d{  –—† }|j                  }| j                  j                  |«      }| j                  j                  d«      }|dk(  r"|s |st	        |t
        «      rt        d|› �«      ‚|D ]&  } ||«      }|j                  |«      sŒ|ƒ d{  –—†  Œ( |D ]&  } ||«      }|j                  |«      sŒ|ƒ d{  –—†  Œ( ŒÉ7 ŒÄ7 Œ47 Œ6 y­w)al  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: )rÚ   r‰   rt   Úget_handlersrŽ   r#   r   Úiscoroutine)rI   rÚ   r”   r•   ÚspecificÚgenericrû   rä   s           rJ   Údispatch_eventsz$AsyncForksConnection.dispatch_events}  së   è ø€ ó 	à÷ 	!ð 	!�%ØŸ™ˆJØ×3Ñ3×@Ñ@ÀÓLˆHØ×2Ñ2×?Ñ?ÀÓHˆGà˜WÒ$©X¹gÜ˜e¤ZÔ0Ü%Ð(9¸%¸Ð&AÓBÐBà#ò !�Ù  ›�Ø×&Ñ& vÕ.Ø —L‘Lð!ð
 #ò !�Ù  ›�Ø×&Ñ& vÕ.Ø —L‘Lñ!ð	!øð !øð
 !øñ#  ùsV   ‚C‰C�CŽC‘BCÂCÂCÂ $CÃCÃ
CÃCÃCÃCÃCÃC)rv   ra   rd   zFCallable[[Query, Headers], Awaitable[AsyncWebSocketConnection]] | Noner=   rN   r>   rO   r?   rP   r@   rP   r:   r   r;   r   re   úSendQueue | NonerQ   rí   )rQ   zAsyncIterator[ForkServerEvent]©rQ   r%   ©rQ   Úbytes©r”   z&ForkClientEvent | ForkClientEventParamrQ   rí   ©r±   zbytes | strrQ   rí   ©r¼   rO   r½   rM   rQ   rí   ©r±   zstr | bytesrQ   r%   ©rƒ   r¯   rQ   Úbool©rQ   rí   rè   )r•   rM   rû   úCallable[..., Any] | NonerQ   zOUnion[AsyncForksConnection, Callable[[Callable[..., Any]], Callable[..., Any]]])r•   rM   rû   rù   rQ   r[   )rS   rT   rU   Ú__doc__Ú__annotations__rw   r…   r   r�   r®   r¸   rÁ   rŒ   r€   rá   rü   r  r  r  rV   rL   rJ   r[   r[   n   s&  … ÙAà&Ó&Ø(Ó(à)Ó)ð [_Ø^bØØ"ØØØ!#Ø'+ñ9à,ð9ð Xð	9ð
 \ð9ð ð9ð ð9ð ð9ð ð9ð ð9ð %ð9ð 
ó9ó<ó,ó$ó*ó*ð *.¸Rõ ?óyóKóZ	Fð EIðØðØ(Aðà	Xóó8ð EIðØðØ(Aðà	Xóô"!rL   r[   c                  óÀ   — e Zd ZdZddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdd	„Z	 d	 	 	 	 	 dd
„Zdd„Z	 d	 	 	 	 	 dd„Zdd„Z	e	Z
dd„Zdd„Z	 	 	 	 	 	 	 	 dd„Zy)rY   a*  
    Context manager over a `AsyncForksConnection` that is returned by `live.forks.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.live.forks.connect(...).enter()
    # ...
    await connection.close()
    ```
    Nr5   r6   r7   r8   ©r=   r>   r?   r@   rA   c       
        óÔ   — || _         || _        d | _        || _        || _        || _        || _        || _        || _        |	| _	        t        |
¬«      | _        t        d¬«      | _        y )N©Ú	max_bytesFrg   )Ú$_AsyncForksConnectionManager__clientÚ(_AsyncForksConnectionManager__session_idÚ(_AsyncForksConnectionManager__connectionÚ)_AsyncForksConnectionManager__extra_queryÚ+_AsyncForksConnectionManager__extra_headersÚ:_AsyncForksConnectionManager__websocket_connection_optionsÚ-_AsyncForksConnectionManager__on_reconnectingÚ)_AsyncForksConnectionManager__max_retriesÚ+_AsyncForksConnectionManager__initial_delayÚ'_AsyncForksConnectionManager__max_delayr    Ú(_AsyncForksConnectionManager__send_queuer"   Ú4_AsyncForksConnectionManager__event_handler_registry©rI   rD   rE   r:   r;   r<   r=   r>   r?   r@   rA   s              rJ   rw   z$AsyncForksConnectionManager.__init__°  sm   € ð ˆŒØ&ˆÔØ9=ˆÔØ(ˆÔØ,ˆÔØ.JˆÔ+Ø!0ˆÔØ(ˆÔØ,ˆÔØ$ˆÔÜ%°Ô?ˆÔÜ(<ÀeÔ(LˆÕ%rL   c                óÈ   — t        |t        «      r|j                  ddd¬«      n"t        j                  t        |t        «      «      }| j                  j                  |«       y©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)   r1  r­   r°   s      rJ   r®   z AsyncForksConnectionManager.sendË  óR   € ô ˜%¤Ô+ð �M‰M¨¸tÐSWˆMÔXä—‘œO¨EÔ3GÓHÓIð 	ð
 	×Ñ×!Ñ! $Õ'rL   c                óX   ‡ ‡— |�‰ j                   j                  ‰|«       ‰ S dˆˆ fd„}|S )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 ``AsyncForksConnection.on``.
        c                ó@   •— ‰j                   j                  ‰| «       | S rè   ©r2  ró   rô   s    €€rJ   rö   z1AsyncForksConnectionManager.on.<locals>.decoratorä  ó   ø€ Ø×)Ñ)×-Ñ-¨j¸"Ô=ØˆIrL   rø   r9  rú   s   ``  rJ   rü   zAsyncForksConnectionManager.onØ  ó3   ù€ ð ÐØ×)Ñ)×-Ñ-¨j¸'ÔBØˆKö	ð ÐrL   c                ó>   — | j                   j                  ||«       | S rÿ   )r2  r  r  s      rJ   r  zAsyncForksConnectionManager.offê  ó   € à×%Ñ%×,Ñ,¨Z¸ÔAØˆrL   c                ó\   ‡ ‡— |� ‰ j                   j                  ‰|d¬«       ‰ S dˆˆ fd„}|S )úGRegister a one-time event handler before the connection is established.Tr  c                óD   •— ‰j                   j                  ‰| d¬«       | S r
  r9  rô   s    €€rJ   rö   z3AsyncForksConnectionManager.once.<locals>.decorator÷  ó#   ø€ Ø×)Ñ)×-Ñ-¨j¸"À4Ð-ÔHØˆIrL   rø   r9  rú   s   ``  rJ   r  z AsyncForksConnectionManager.onceï  ó8   ù€ ð ÐØ×)Ñ)×-Ñ-¨j¸'ÈÐ-ÔMØˆKö	ð ÐrL   c              ƒ  ó  K  — | j                  | j                  | j                  «      ƒ d{  –—† }t        || j                  �| j                   nd| j                  | j
                  | j                  | j                  | j                  | j                  | j                  ¬«	      | _	        | j                  j                  | j                  j                  «       | j                  j                  «       ƒ d{  –—†  | j                  S 7 ŒØ7 Œ­w)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 = await client.live.forks.connect(...).enter()
        # ...
        await connection.close()
        ```
        Nrc   )Ú_connect_wsr*  r+  r[   r-  r.  r/  r0  r1  r)  r2  Ú
merge_intort   rá   ©rI   Úwss     rJ   Ú
__aenter__z&AsyncForksConnectionManager.__aenter__ý  sá   è ø€ ð ×#Ñ# D×$6Ñ$6¸×8LÑ8LÓM×Mˆä0ØØ(,×(>Ñ(>Ð(J�D×$Ò$ÐPTØ ×2Ñ2Ø×*Ñ*Ø×.Ñ.Ø×&Ñ&Ø×*Ñ*Ø×.Ñ.Ø×(Ñ(ô

ˆÔð 	×%Ñ%×0Ñ0°×1BÑ1B×1ZÑ1ZÔ[Ø×Ñ×1Ñ1Ó3×3Ð3à× Ñ Ð ð# Nøð 	4ús"   ‚*D	¬D­CD	Ã4DÃ5D	ÄD	c           
   ƒ  óZ  K  — 	 ddl m} | j	                  «       j                  i | j                  j                  j                  ¥|¥¬«      }|j                  dddœj                  |j                  |j                  «      ¬«      }| j                  j                  t        j                  d	t        |«      t        |«      d
di¬«      «      ƒ d {  –—† }| j                  j	                  |j                   «      j#                  | j                  j$                  j'                  t)        t*        |j                  «      «      «      }|j                  dddœj                  |j                  |j                  «      ¬«      }| j                  j,                  i | j                  j.                  t1        |j2                  «      r|j2                  ni fD ���	ci c]-  }|j5                  «       D ]  \  }}	|j7                  «       ||	f“Œ Œ/ }
}}}	t8        j;                  d«       | j<                  rt8        j;                  d«        |t        |«      fd t?        t        |
jA                  «       «      i «      dœ| j<                  ¤Žƒ d {  –—† S # t        $ r}t        d«      |‚d }~ww xY w7 �ŒÑc c}	}}w 7 Œ+­w)Nr   )Ú_WebSocketConnectú9You need to install `openai[realtime]` to use this method©ÚparamsrG  Úwss©ÚhttpÚhttps©Úschemer‘   Úbearer_authT©ÚmethodÚurlÚheadersÚsecurityúConnecting to WebSocket APIú,Custom WebSocket connection options provided©Úuser_agent_headerÚadditional_headers)!Úlib._websocketrJ  ÚImportErrorr   Ú_prepare_urlÚ	copy_withr'  Úbase_urlrM  r‘   rS  Ú_prepare_optionsr   Ú	constructrM   r�   rW  Úcopy_merge_paramsÚqsÚ	stringifyr   r   Úauth_headersÚdefault_headersr   rX  ÚitemsÚlowerr3   rœ   r,  r!   Úvalues©rI   r:   r;   rK   rƒ   rW  ÚoptionsÚ
header_setÚkeyrÅ   rX  s              rJ   rD  z'AsyncForksConnectionManager._connect_ws  sd  è ø€ ð	dÝFð ×ÑÓ!×+Ñ+ðØ—-‘-×(Ñ(×/Ñ/ðàðð ,ó 
ˆð �m‰m¨D¸5Ñ#A×#EÑ#EÀcÇjÁjÐRU×R\ÑR\Ó#]ˆmÓ^ˆØŸ™×6Ñ6Ü×)Ñ)ØÜ˜“HÜ˜]Ó+Ø'¨Ð.ô	ó
÷ 
ˆð �m‰m×(Ñ(¨¯©Ó5×GÑGØ�M‰M×Ñ×&Ñ&¤t¬C°·±Ó'@ÓAó
ˆð �m‰m¨D¸5Ñ#A×#EÑ#EÀcÇjÁjÐRU×R\ÑR\Ó#]ˆmÓ^ˆð —‘×*Ñ*ØØ—‘×-Ñ-Ü#+¨G¯O©OÔ#<�—’À"ð	÷	
ð 	
àð )×.Ñ.Ó0ò	
ñ ��Uð �I‰I‹K˜#˜u˜Ñ%ð	
Øð	
ˆò 	
ô 	�	‰	Ð/Ô0Ø×.Ò.Ü�I‰IÐDÔEáÜ�‹Hð
à"Ü.¬t°G·N±NÓ4DÓ/EÀrÓJñ
ð ×1Ñ1ñ	
÷ 
ð 	
øôI ò 	dÜÐYÓZÐ`cÐcûð	dúð
ûô	
ð
úsT   ‚J+„J ŠCJ+ÃJÃC?J+Ç2J"È A=J+É=J)É>J+Ê	JÊJÊJÊJ+Ê"J+c                óÈ  — | j                   j                  �*t        j                  | j                   j                  «      }nO| j                   j                  j
                  }|dk(  rdnd}| j                   j                  j                  |¬«      }|j                  j                  d«      t        d| j                  ¬«      j                  d«      z   }|j                  |¬	«      S ©
NrP  rG  rN  rR  ó   /z /live/sessions/{session_id}/fork)rE   r´   )Úraw_path)r'  Úwebsocket_base_urlÚhttpx2ÚURLÚ	_base_urlrS  rb  ru  Úrstripr   r(  Úencode©rI   rc  rS  Ú	ws_schemeÚmerge_raw_paths        rJ   ra  z(AsyncForksConnectionManager._prepare_urlM  ó¶   € Ø�=‰=×+Ñ+Ð7Ü—z‘z $§-¡-×"BÑ"BÓC‰Hà—]‘]×,Ñ,×3Ñ3ˆFØ &¨&Ò 0™°eˆIØ—}‘}×.Ñ.×8Ñ8À	Ð8ÓJˆHà!×*Ñ*×1Ñ1°$Ó7¼-Ø.¸4×;LÑ;Lô;
ç
‰&�‹/ñˆð ×!Ñ!¨>Ð!Ó:Ð:rL   c              ƒ  ón   K  — | j                   �#| j                   j                  «       ƒ d {  –—†  y y 7 Œ­wrè   )r)  rÁ   ©rI   Úexc_typerƒ   Úexc_tbs       rJ   Ú	__aexit__z%AsyncForksConnectionManager.__aexit__Z  s4   è ø€ ð ×ÑÐ(Ø×#Ñ#×)Ñ)Ó+×+Ñ+ð )Ø+ús   ‚*5¬3­5)rD   r0   rE   rM   r:   r   r;   r   r<   r*   r=   rN   r>   rO   r?   rP   r@   rP   rA   rO   rQ   rí   r  rè   )r•   rM   rû   r  rQ   zVUnion[AsyncForksConnectionManager, Callable[[Callable[..., Any]], Callable[..., Any]]])r•   rM   rû   rù   rQ   rY   )rQ   r[   )r:   r   r;   r   rQ   ra   ©rQ   z
httpx2.URL©r‚  ztype[BaseException] | Nonerƒ   zBaseException | Nonerƒ  zTracebackType | NonerQ   rí   )rS   rT   rU   r   rw   r®   rü   r  r  rH  ÚenterrD  ra  r„  rV   rL   rJ   rY   rY   œ  s*  „ ñð6 _cØØ"ØØ'ñMð ðMð ð	Mð
 ðMð ðMð 'AðMð \ðMð ðMð ðMð ðMð ðMð 
óMó6(ð EIðØðØ(Aðà	_óó$ð EIðØðØ(Aðà	_óó!ð@ €Eó,
ó\;ð,Ø2ð,Ø9Mð,ØWkð,à	ô,rL   rY   c            	      óþ   — e Zd ZU dZded<   ded<   ded<   ddd	d
di i ddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdd„Zd d„Zd!d„Zd"d„Z	d#d„Z
dddœd$d„Zd%d„Zd&d„Zd'd„Z	 d(	 	 	 	 	 d)d„Zd*d„Z	 d(	 	 	 	 	 d)d„Zd'd„Zy)+ÚForksConnectionr\   ÚForksSessionResourcer^   ÚForksResponseResourcer`   ÚWebSocketConnectionrb   Nr5   r6   r7   rc   c               ó&  — || _         || _        || _        || _        d| _        || _        || _        || _        || _        d| _	        d| _
        |	xs
 t        «       | _        t        d¬«      | _        t        | «      | _        t#        | «      | _        y )Nr   FTrg   )rb   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   r    rs   r"   rt   rŠ  r^   r‹  r`   ru   s
             rJ   rw   zForksConnection.__init__i  sŽ   € ð &ˆÔØˆŒØ /ˆÔØ'ˆÔØ"#ˆÔØ+ˆÔØ#ˆŒØ'ˆÔØ+ˆÔØ%*ˆÔ"Ø %ˆÔØ%Ò4¬«ˆÔÜ';ÀTÔ'JˆÔ$ä+¨DÓ1ˆŒÜ-¨dÓ3ˆ�rL   c              #  óì   K  — ddl m}m} 	 	 | j                  «       –— Œ# |$ r Y y|$ rF}| j	                  |«      s+| j
                  j                  «       }|rt        d|¬«      |‚‚ Y d}~ŒMd}~ww xY w­wry   r}   r‚   s        rJ   Ú__iter__zForksConnection.__iter__‡  s†   è ø€ ÷
 	TàðØ—i‘i“kÒ!ð øð &ò ÙØ(ò Ø—‘ sÔ+Ø!×-Ñ-×3Ñ3Ó5�FÙÜ<ØNØ,2ôð  #ð#ð ô ,ûðüs4   ‚
A4�  ŸA4 A1¥A4§A1«<A,Á'A4Á,A1Á1A4c                ó  — | j                  | j                  «       «      }t        t        t        |«      t
        «      rt        d|«      j                  d«      nt        |dd«      }t        |t        «      r|r|dk7  rd| _	        |S )r‡   rˆ   r‰   NrŠ   r   r‹   r“   s      rJ   r   zForksConnection.recv�  sy   € ð × Ñ  §¡Ó!2Ó3ˆô œ$œv uÓ-¬tÔ4ô Ð$ eÓ,×0Ñ0°Ô8ä˜ ¨Ó-ð 	ô �j¤#Ô&©:¸*ÈÒ:OØ&'ˆDÔ#ØˆrL   c                ó„  — | j                   j                  d¬«      }t        j                  dt	        |«      «       | j
                  ra	 t        j                  |«      }t        |t        «      rt        d|«      j                  d«      nd}t        |t        «      r|r|dk7  rd| _        |S # t        t        f$ r |cY S w xY w)	r—   Fr˜   rš   rˆ   r‰   NrŠ   r   r›   r¢   s       rJ   r�   zForksConnection.recv_bytes¯  s±   € ð ×"Ñ"×'Ñ'¨uÐ'Ó5ˆÜ�	‰	Ð8¼#¸g»,ÔGØ×"Ò"ðÜ%)§Z¡Z°Ó%8�
ô OYÐYcÔeiÔNjœÐ1°:Ó>×BÑBÀ6ÔJÐptˆJÜ˜*¤cÔ*©z¸jÈGÒ>SØ*+�Ô'Øˆøô ¤Ð/ò Ø’ðús   Á	B+ Â+B?Â>B?c                ól  — t        |t        «      r|j                  ddd¬«      n"t        j                  t        |t        «      «      }| j                  r| j                  j                  |«       y 	 | j                  j                  |«       y # t        $ r | j                  j                  |«       ‚ w xY wr¦   )rŽ   r   r«   rž   r¬   r   r)   rr   rs   r­   rb   r®   r¯   r°   s      rJ   r®   zForksConnection.sendÄ  s�   € ô ˜%¤Ô+ð �M‰M¨¸tÐSWˆMÔXä—‘œO¨EÔ3GÓHÓIð 	ð
 × Ò Ø×Ñ×$Ñ$ TÔ*Øð	Ø×Ñ×!Ñ! $Õ'øÜò 	Ø×Ñ×$Ñ$ TÔ*Øð	ús   Á1B Â&B3c                óÐ   — | j                   r?t        |t        «      r|n|j                  d«      }| j                  j                  |«       y | j                  j                  |«       y r³   rµ   r¶   s      rJ   r¸   zForksConnection.send_rawÓ  sO   € Ø× Ò Ü$ T¬3Ô/‘$°T·[±[ÀÓ5IˆCØ×Ñ×$Ñ$ SÔ)ØØ×Ñ×Ñ˜dÕ#rL   r¹   rº   r»   c               óL   — d| _         | j                  j                  ||¬«       y r¿   rÀ   rÂ   s      rJ   rÁ   zForksConnection.closeÚ  s#   € Ø%)ˆÔ"Ø×Ñ×Ñ D°ÐÕ8rL   c           
     ó‚   — t        t        t        t        j                  |«      t        t
        t        «      ¬«      «      S rÄ   rÇ   rÈ   s     rJ   rŒ   zForksConnection.parse_eventÞ  rÉ   rL   c           	     óZ  — | j                   �| j                  €yddlm} d}t	        ||«      r"|j
                  �|j
                  j                  }t        |«      syd| _        t        | j                  dz   | j                  dz   «      D �]q  }|| _
        t        | j                  d|dz
  z  z  | j                  «      }dt        j                  «       d	z  z   }||z  }t!        || j                  ||| j"                  | j$                  ¬
«      }	 | j                  |«      }	|	�|	j)                  d«      r	d| _         y|	�d|	v r
|	d   | _        d|	v r
|	d   | _        t*        j-                  d|| j                  |«       t/        j0                  |«       | j2                  r	d| _         y	 | j                  | j"                  | j$                  «      | _        t*        j-                  d«       d| _        | j7                  «         y d| _        y# t&        $ r d| _        Y  yw xY w# t&        $ r Y �Œ w xY w)rË   Fr   rÌ   rÍ   TrÎ   rÏ   rÐ   rÑ   rÒ   r×   r:   r;   rØ   rÙ   )rj   ri   r~   r{   rŽ   rÛ   r¼   r(   rr   rÜ   rl   rk   rÝ   rm   rn   rÞ   r&   ro   rp   r¯   r‘   r3   rß   Útimerà   rq   rb   rá   )
rI   rƒ   r{   rÖ   rÓ   râ   rã   rÕ   r”   rä   s
             rJ   r€   zForksConnection._reconnectæ  s(  € ð × Ñ Ð(¨D¯M©MÐ,AØå?àˆ
Ü�cÐ0Ô1°c·h±hÐ6JØŸ™Ÿ™ˆJä# JÔ/Øà $ˆÔä˜T×4Ñ4°qÑ8¸$×:KÑ:KÈaÑ:OÓPó 2	ˆGØ&-ˆDÔ#Ü˜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Ø(-�Ô%ÙàÐ!Ø  FÑ*Ø(.¨}Ñ(=�DÔ%Ø" fÑ,Ø*0°Ñ*A�DÔ'ä�H‰HØQØØ×!Ñ!Øô	ô �J‰J�uÔà×)Ò)Ø(-�Ô%ÙðØ#'§=¡=°×1BÑ1BÀD×DWÑDWÓ#X�Ô Ü—‘Ð7Ô8Ø(-�Ô%Ø×&Ñ&Ô(Ùða2	ðh !&ˆÔØøôI ò Ø(-�Ô%Úðûô@ ò Úðús%   ÄHÆ$AHÈHÈHÈ	H*È)H*c                óŒ   ‡ — 	 ‰ j                   j                  ˆ fd„«       y# t        $ r t        j	                  d«       Y yw xY w)ræ   c                ó:   •— ‰j                   j                  | «      S rè   ré   rê   s    €rJ   ú<lambda>z3ForksConnection._flush_send_queue.<locals>.<lambda>4  s   ø€ °T×5EÑ5E×5JÑ5JÈ4Ó5P€ rL   rì   N)rs   Ú
flush_syncr¯   r3   rï   ©rI   s   `rJ   rá   z!ForksConnection._flush_send_queue1  s<   ø€ ð	FØ×Ñ×'Ñ'Ó(PÕQøÜò 	FÜ�K‰KÐDÖEð	Fús   ƒ" ¢AÁAc                óX   ‡ ‡— |�‰ j                   j                  ‰|«       ‰ S dˆˆ fd„}|S )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("session.started", my_handler)

        Or as a decorator::

            @connection.on("session.started")
            def my_handler(event): ...
        c                ó@   •— ‰j                   j                  ‰| «       | S rè   rò   rô   s    €€rJ   rö   z%ForksConnection.on.<locals>.decoratorN  r÷   rL   rø   rò   rú   s   ``  rJ   rü   zForksConnection.on8  rý   rL   c                ó>   — | j                   j                  ||«       | S rÿ   r   r  s      rJ   r  zForksConnection.offT  r  rL   c                ó\   ‡ ‡— |� ‰ j                   j                  ‰|d¬«       ‰ S dˆˆ fd„}|S )r  Tr  c                óD   •— ‰j                   j                  ‰| d¬«       | S r
  rò   rô   s    €€rJ   rö   z'ForksConnection.once.<locals>.decoratord  r  rL   rø   rò   rú   s   ``  rJ   r  zForksConnection.onceY  r  rL   c                ó   — | D ]‰  }|j                   }| j                  j                  |«      }| j                  j                  d«      }|dk(  r"|s |st        |t        «      rt        d|› �«      ‚|D ]
  } ||«       Œ |D ]
  } ||«       Œ Œ‹ y)ay  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‰   rt   r  rŽ   r#   r   )rI   r”   r•   r  r  rû   s         rJ   r  zForksConnection.dispatch_eventsj  sŸ   € ð ò 	ˆEØŸ™ˆJØ×3Ñ3×@Ñ@ÀÓLˆHØ×2Ñ2×?Ñ?ÀÓHˆGà˜WÒ$©X¹gÜ˜e¤ZÔ0Ü%Ð(9¸%¸Ð&AÓBÐBà#ò �Ù˜•ðð #ò �Ù˜•ññ	rL   )rv   rŒ  rd   z6Callable[[Query, Headers], WebSocketConnection] | Noner=   rN   r>   rO   r?   rP   r@   rP   r:   r   r;   r   re   r  rQ   rí   )rQ   zIterator[ForkServerEvent]r  r  r  r  r  r  r  r  rè   )r•   rM   rû   r  rQ   zJUnion[ForksConnection, Callable[[Callable[..., Any]], Callable[..., Any]]])r•   rM   rû   rù   rQ   r‰  )rS   rT   rU   r   r!  rw   r�  r   r�   r®   r¸   rÁ   rŒ   r€   rá   rü   r  r  r  rV   rL   rJ   r‰  r‰  a  s&  … ÙAà!Ó!Ø#Ó#à$Ó$ð KOØ^bØØ"ØØØ!#Ø'+ñ4à'ð4ð Hð	4ð
 \ð4ð ð4ð ð4ð ð4ð ð4ð ð4ð %ð4ð 
ó4ó<ó,ó$ó*ó$ð $(°rõ 9óyóIóVFð EIðØðØ(Aðà	Sóó8ð EIðØðØ(Aðà	Sóô"rL   r‰  c                  óÀ   — e Zd ZdZddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdd	„Z	 d	 	 	 	 	 dd
„Zdd„Z	 d	 	 	 	 	 dd„Zdd„Z	e	Z
dd„Zdd„Z	 	 	 	 	 	 	 	 dd„Zy)rF   a  
    Context manager over a `ForksConnection` that is returned by `live.forks.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.live.forks.connect(...).enter()
    # ...
    connection.close()
    ```
    Nr5   r6   r7   r8   r#  c       
        óÔ   — || _         || _        d | _        || _        || _        || _        || _        || _        || _        |	| _	        t        |
¬«      | _        t        d¬«      | _        y )Nr%  Trg   )Ú_ForksConnectionManager__clientÚ#_ForksConnectionManager__session_idÚ#_ForksConnectionManager__connectionÚ$_ForksConnectionManager__extra_queryÚ&_ForksConnectionManager__extra_headersÚ5_ForksConnectionManager__websocket_connection_optionsÚ(_ForksConnectionManager__on_reconnectingÚ$_ForksConnectionManager__max_retriesÚ&_ForksConnectionManager__initial_delayÚ"_ForksConnectionManager__max_delayr    Ú#_ForksConnectionManager__send_queuer"   Ú/_ForksConnectionManager__event_handler_registryr3  s              rJ   rw   zForksConnectionManager.__init__—  sm   € ð ˆŒØ&ˆÔØ48ˆÔØ(ˆÔØ,ˆÔØ.JˆÔ+Ø!0ˆÔØ(ˆÔØ,ˆÔØ$ˆÔÜ%°Ô?ˆÔÜ(<ÀdÔ(KˆÕ%rL   c                óÈ   — t        |t        «      r|j                  ddd¬«      n"t        j                  t        |t        «      «      }| j                  j                  |«       yr5  )	rŽ   r   r«   rž   r¬   r   r)   r¯  r­   r°   s      rJ   r®   zForksConnectionManager.send²  r6  rL   c                óX   ‡ ‡— |�‰ j                   j                  ‰|«       ‰ S dˆˆ fd„}|S )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 ``ForksConnection.on``.
        c                ó@   •— ‰j                   j                  ‰| «       | S rè   ©r°  ró   rô   s    €€rJ   rö   z,ForksConnectionManager.on.<locals>.decoratorË  r:  rL   rø   r´  rú   s   ``  rJ   rü   zForksConnectionManager.on¿  r;  rL   c                ó>   — | j                   j                  ||«       | S rÿ   )r°  r  r  s      rJ   r  zForksConnectionManager.offÑ  r=  rL   c                ó\   ‡ ‡— |� ‰ j                   j                  ‰|d¬«       ‰ S dˆˆ fd„}|S )r?  Tr  c                óD   •— ‰j                   j                  ‰| d¬«       | S r
  r´  rô   s    €€rJ   rö   z.ForksConnectionManager.once.<locals>.decoratorÞ  rA  rL   rø   r´  rú   s   ``  rJ   r  zForksConnectionManager.onceÖ  rB  rL   c                óæ  — | j                  | j                  | j                  «      }t        || j                  �| j                   nd| j                  | j
                  | j                  | j                  | j                  | j                  | j                  ¬«	      | _	        | j                  j                  | j                  j                  «       | j                  j                  «        | j                  S )as  
        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.live.forks.connect(...).enter()
        # ...
        connection.close()
        ```
        Nrc   )rD  r¨  r©  r‰  r«  r¬  r­  r®  r¯  r§  r°  rE  rt   rá   rF  s     rJ   Ú	__enter__z ForksConnectionManager.__enter__ä  sÈ   € ð ×Ñ˜d×0Ñ0°$×2FÑ2FÓGˆä+ØØ(,×(>Ñ(>Ð(J�D×$Ò$ÐPTØ ×2Ñ2Ø×*Ñ*Ø×.Ñ.Ø×&Ñ&Ø×*Ñ*Ø×.Ñ.Ø×(Ñ(ô

ˆÔð 	×%Ñ%×0Ñ0°×1BÑ1B×1ZÑ1ZÔ[Ø×Ñ×+Ñ+Ô-à× Ñ Ð rL   c           
     ó(  — 	 ddl m} | j	                  «       j                  i | j                  j                  j                  ¥|¥¬«      }|j                  dddœj                  |j                  |j                  «      ¬«      }| j                  j                  t        j                  d	t        |«      t        |«      d
di¬«      «      }| j                  j	                  |j                   «      j#                  | j                  j$                  j'                  t)        t*        |j                  «      «      «      }|j                  dddœj                  |j                  |j                  «      ¬«      }| j                  j,                  i | j                  j.                  t1        |j2                  «      r|j2                  ni fD ���	ci c]-  }|j5                  «       D ]  \  }}	|j7                  «       ||	f“Œ Œ/ }
}}}	t8        j;                  d«       | j<                  rt8        j;                  d«        |t        |«      fd t?        t        |
jA                  «       «      i «      dœ| j<                  ¤ŽS # t        $ r}t        d«      |‚d }~ww xY wc c}	}}w )Nr   )rK   rK  rL  rG  rN  rO  rR  r‘   rT  TrU  rZ  r[  r\  )!Úwebsockets.sync.clientrK   r`  r   ra  rb  r¥  rc  rM  r‘   rS  rd  r   re  rM   r�   rW  rf  rg  rh  r   r   ri  rj  r   rX  rk  rl  r3   rœ   rª  r!   rm  rn  s              rJ   rD  z"ForksConnectionManager._connect_ws  sK  € ð	dÝ6ð ×ÑÓ!×+Ñ+ðØ—-‘-×(Ñ(×/Ñ/ðàðð ,ó 
ˆð �m‰m¨D¸5Ñ#A×#EÑ#EÀcÇjÁjÐRU×R\ÑR\Ó#]ˆmÓ^ˆØ—-‘-×0Ñ0Ü×)Ñ)ØÜ˜“HÜ˜]Ó+Ø'¨Ð.ô	ó
ˆð �m‰m×(Ñ(¨¯©Ó5×GÑGØ�M‰M×Ñ×&Ñ&¤t¬C°·±Ó'@ÓAó
ˆð �m‰m¨D¸5Ñ#A×#EÑ#EÀcÇjÁjÐRU×R\ÑR\Ó#]ˆmÓ^ˆð —‘×*Ñ*ØØ—‘×-Ñ-Ü#+¨G¯O©OÔ#<�—’À"ð	÷	
ð 	
àð )×.Ñ.Ó0ò	
ñ ��Uð �I‰I‹K˜#˜u˜Ñ%ð	
Øð	
ˆò 	
ô 	�	‰	Ð/Ô0Ø×.Ò.Ü�I‰IÐDÔEáÜ�‹Hð
à"Ü.¬t°G·N±NÓ4DÓ/EÀrÓJñ
ð ×1Ñ1ñ	
ð 	
øôI ò 	dÜÐYÓZÐ`cÐcûð	düô,	
s   ‚I0 Ç2JÉ0	J
É9JÊJ
c                óÈ  — | j                   j                  �*t        j                  | j                   j                  «      }nO| j                   j                  j
                  }|dk(  rdnd}| j                   j                  j                  |¬«      }|j                  j                  d«      t        d| j                  ¬«      j                  d«      z   }|j                  |¬	«      S rs  )r¥  rv  rw  rx  ry  rS  rb  ru  rz  r   r¦  r{  r|  s        rJ   ra  z#ForksConnectionManager._prepare_url4  r  rL   c                óR   — | j                   �| j                   j                  «        y y rè   )r§  rÁ   r�  s       rJ   Ú__exit__zForksConnectionManager.__exit__A  s'   € ð ×ÑÐ(Ø×Ñ×#Ñ#Õ%ð )rL   )rD   r/   rE   rM   r:   r   r;   r   r<   r*   r=   rN   r>   rO   r?   rP   r@   rP   rA   rO   rQ   rí   r  rè   )r•   rM   rû   r  rQ   zQUnion[ForksConnectionManager, Callable[[Callable[..., Any]], Callable[..., Any]]])r•   rM   rû   rù   rQ   rF   )rQ   r‰  )r:   r   r;   r   rQ   rŒ  r…  r†  )rS   rT   rU   r   rw   r®   rü   r  r  r¹  r‡  rD  ra  r¾  rV   rL   rJ   rF   rF   ƒ  s*  „ ñð6 _cØØ"ØØ'ñLð ðLð ð	Lð
 ðLð ðLð 'AðLð \ðLð ðLð ðLð ðLð ðLð 
óLó6(ð EIðØðØ(Aðà	Zóó$ð EIðØðØ(Aðà	Zóó!ð@ €Eó,
ó\;ð&Ø2ð&Ø9Mð&ØWkð&à	ô&rL   rF   c                  ó   — e Zd Zdd„Zy)ÚBaseForksConnectionResourcec                ó   — || _         y rè   ©rb   ©rI   rv   s     rJ   rw   z$BaseForksConnectionResource.__init__I  ó
   € Ø%ˆÕrL   N)rv   r‰  rQ   rí   ©rS   rT   rU   rw   rV   rL   rJ   rÀ  rÀ  H  ó   „ ô&rL   rÀ  c                  ó~   — e Zd Zed
d„«       Zedd„«       Zedd„«       Zedd„«       Zedœdd„Z	edœdd„Z
edœdd„Zy	)rŠ  c                ó,   — t        | j                  «      S rè   )ÚForksSessionCommentaryResourcerb   rœ  s    rJ   Ú
commentaryzForksSessionResource.commentaryN  ó   € ä-¨d×.>Ñ.>Ó?Ð?rL   c                ó,   — t        | j                  «      S rè   )ÚForksSessionInputAudioResourcerb   rœ  s    rJ   Úinput_audioz ForksSessionResource.input_audioR  rË  rL   c                ó,   — t        | j                  «      S rè   )Ú ForksSessionInstructionsResourcerb   rœ  s    rJ   Úinstructionsz!ForksSessionResource.instructionsV  s   € ä/°×0@Ñ0@ÓAÐArL   c                ó,   — t        | j                  «      S rè   )ÚForksSessionThinkingResourcerb   rœ  s    rJ   ÚthinkingzForksSessionResource.thinkingZ  s   € ä+¨D×,<Ñ,<Ó=Ð=rL   ©Úevent_idc               óp   — | j                   j                  t        t        t	        d||dœ«      «      «       y©u¨   
        Start a Live session after connecting to a stored sessionâ€™s fork WebSocket.

        Send an empty `session` object to use the stored configuration.
        zsession.start©r‰   r^   rÖ  N©rb   r®   r   r)   r   ©rI   r^   rÖ  s      rJ   ÚstartzForksSessionResource.start^  s3   € ð 	×Ñ×ÑÜÜ$Ü¨ÀWÐZbÑ cÓdóõ	
rL   c          
     ón   — | j                   j                  t        t        t	        d|dœ«      «      «       y©z…Request that the Live session close.

        The terminal `session.closed` event contains the close reason and final usage.
        zsession.close©r‰   rÖ  NrÚ  ©rI   rÖ  s     rJ   rÁ   zForksSessionResource.closek  s.   € ð
 	×Ñ×ÑÜÔ%¤ÀÐ]eÑ7fÓ'gÓhõ	
rL   c               óp   — | j                   j                  t        t        t	        d||dœ«      «      «       y©zŒUpdate the delegation settings of an active Live session.

        The server acknowledges accepted changes with `session.updated`.
        zsession.updaterÙ  NrÚ  rÛ  s      rJ   ÚupdatezForksSessionResource.updatet  s4   € ð
 	×Ñ×ÑÜÜ$ÜÐ)9ÀgÐ[cÑ dÓeóõ	
rL   N)rQ   rÉ  )rQ   rÍ  )rQ   rÐ  )rQ   rÓ  ©r^   r+   rÖ  úOptional[str] | OmitrQ   rí   ©rÖ  rå  rQ   rí   ©r^   r,   rÖ  rå  rQ   rí   ©rS   rT   rU   r   rÊ  rÎ  rÑ  rÔ  r   rÜ  rÁ   rã  rV   rL   rJ   rŠ  rŠ  M  sx   „ Øò@ó ð@ð ò@ó ð@ð òBó ðBð ò>ó ð>ð Z^õ 
ð 9=õ 
ð ]aö 

rL   rŠ  c                  ó   — e Zd Zedœdd„Zy)rÉ  rÕ  c               ór   — | j                   j                  t        t        t	        d|||dœ«      «      «       y©z{
        Provide context the Live model can communicate to the user, optionally for an existing client delegation.
        zsession.commentary.append©r‰   ÚcontentÚdelegation_idrÖ  NrÚ  ©rI   rí  rî  rÖ  s       rJ   Úappendz%ForksSessionCommentaryResource.append‚  s<   € ð 	×Ñ×ÑÜÜ$Üà ;Ø#*Ø)6Ø$,ñ	óó
õ	
rL   N©rí  rM   rî  zOptional[str]rÖ  rå  rQ   rí   ©rS   rT   rU   r   rð  rV   rL   rJ   rÉ  rÉ  �  ó
   „ Øeiö 
rL   rÉ  c                  ó6   — e Zd Zedœdd„Zedœdd„Zedœdd„Zy)rÍ  rÕ  c               óp   — | j                   j                  t        t        t	        d||dœ«      «      «       y©z‰Send audio to a Live session over its primary WebSocket.

        WebRTC and SIP sessions send audio over their media transport.
        zsession.input_audio.append)r‰   ÚaudiorÖ  NrÚ  ©rI   r÷  rÖ  s      rJ   rð  z%ForksSessionInputAudioResource.append–  s5   € ð
 	×Ñ×ÑÜÜ$ÜÐ)EÐPUÐckÑ lÓmóõ	
rL   c          
     ón   — | j                   j                  t        t        t	        d|dœ«      «      «       y©z‹Mute audio input to the Live model without closing the session.

        The server acknowledges with `session.input_audio.muted`.
        zsession.input_audio.muterß  NrÚ  rà  s     rJ   Úmutez#ForksSessionInputAudioResource.mute¢  s/   € ð
 	×Ñ×ÑÜÔ%¤Ð@ZÐhpÑ7qÓ'rÓsõ	
rL   c          
     ón   — | j                   j                  t        t        t	        d|dœ«      «      «       y©z�Resume audio input to a Live model after muting it.

        The server acknowledges with `session.input_audio.unmuted`.
        zsession.input_audio.unmuterß  NrÚ  rà  s     rJ   Úunmutez%ForksSessionInputAudioResource.unmute«  s/   € ð
 	×Ñ×ÑÜÔ%¤Ð@\ÐjrÑ7sÓ'tÓuõ	
rL   N©r÷  rM   rÖ  rå  rQ   rí   ræ  ©rS   rT   rU   r   rð  rû  rþ  rV   rL   rJ   rÍ  rÍ  •  s   „ ØEIõ 

ð 8<õ 
ð :>ö 
rL   rÍ  c                  ó   — e Zd Zedœdd„Zy)rÐ  rÕ  c               ór   — | j                   j                  t        t        t	        d|||dœ«      «      «       y©z“
        Append instructions to the Live conversation while it is running, optionally associating them with an existing client delegation.
        zsession.instructions.appendrì  NrÚ  rï  s       rJ   rð  z'ForksSessionInstructionsResource.append¶  s<   € ð 	×Ñ×ÑÜÜ$Üà =Ø#*Ø)6Ø$,ñ	óó
õ	
rL   Nrñ  rò  rV   rL   rJ   rÐ  rÐ  µ  ró  rL   rÐ  c                  ó   — e Zd Zedœdd„Zy)rÓ  rÕ  c               ór   — | j                   j                  t        t        t	        d|||dœ«      «      «       y©z
        Provide silent reasoning or progress context to the Live model, optionally for an existing client delegation.
        zsession.thinking.appendrì  NrÚ  rï  s       rJ   rð  z#ForksSessionThinkingResource.appendÊ  s<   € ð 	×Ñ×ÑÜÜ$Üà 9Ø#*Ø)6Ø$,ñ	óó
õ	
rL   Nrñ  rò  rV   rL   rJ   rÓ  rÓ  É  ró  rL   rÓ  c                  ó,   — e Zd Zedd„«       Zedœdd„Zy)r‹  c                ó,   — t        | j                  «      S rè   )ÚForksResponseItemResourcerb   rœ  s    rJ   ÚitemzForksResponseResource.itemÞ  s   € ä(¨×)9Ñ)9Ó:Ð:rL   rÕ  c          
     ón   — | j                   j                  t        t        t	        d|dœ«      «      «       y©u¼   
        Request a response from the Live sessionâ€™s Responses backend, or continue a
        delegated response waiting for tool results.

        Requires Responses delegation.
        zresponse.createrß  NrÚ  rà  s     rJ   ÚcreatezForksResponseResource.createâ  s/   € ð 	×Ñ×ÑÜÔ%¤Ð@QÐ_gÑ7hÓ'iÓjõ	
rL   N)rQ   r	  ræ  ©rS   rT   rU   r   r
  r   r  rV   rL   rJ   r‹  r‹  Ý  s   „ Øò;ó ð;ð :>ö 	
rL   r‹  c                  ó   — e Zd Zedœdd„Zy)r	  rÕ  c               óp   — | j                   j                  t        t        t	        d||dœ«      «      «       y©uš   Add an input item to the Live sessionâ€™s Responses backend.

        Requires Responses delegation; use `response.create` to request a response.
        zresponse.item.create)r‰   r
  rÖ  NrÚ  ©rI   r
  rÖ  s      rJ   r  z ForksResponseItemResource.createï  s4   € ð
 	×Ñ×ÑÜÜ$ÜÐ)?ÈÐ[cÑ dÓeóõ	
rL   N©r
  r-   rÖ  rå  rQ   rí   ©rS   rT   rU   r   r  rV   rL   rJ   r	  r	  î  s
   „ ØW[ö 

rL   r	  c                  ó   — e Zd Zdd„Zy)Ú BaseAsyncForksConnectionResourcec                ó   — || _         y rè   rÂ  rÃ  s     rJ   rw   z)BaseAsyncForksConnectionResource.__init__ý  rÄ  rL   N)rv   r[   rQ   rí   rÅ  rV   rL   rJ   r  r  ü  rÆ  rL   r  c                  ó~   — e Zd Zed
d„«       Zedd„«       Zedd„«       Zedd„«       Zedœdd„Z	edœdd„Z
edœdd„Zy	)r]   c                ó,   — t        | j                  «      S rè   )Ú#AsyncForksSessionCommentaryResourcerb   rœ  s    rJ   rÊ  z$AsyncForksSessionResource.commentary  ó   € ä2°4×3CÑ3CÓDÐDrL   c                ó,   — t        | j                  «      S rè   )Ú#AsyncForksSessionInputAudioResourcerb   rœ  s    rJ   rÎ  z%AsyncForksSessionResource.input_audio  r  rL   c                ó,   — t        | j                  «      S rè   )Ú%AsyncForksSessionInstructionsResourcerb   rœ  s    rJ   rÑ  z&AsyncForksSessionResource.instructions
  s   € ä4°T×5EÑ5EÓFÐFrL   c                ó,   — t        | j                  «      S rè   )Ú!AsyncForksSessionThinkingResourcerb   rœ  s    rJ   rÔ  z"AsyncForksSessionResource.thinking  s   € ä0°×1AÑ1AÓBÐBrL   rÕ  c             ƒ  óŒ   K  — | j                   j                  t        t        t	        d||dœ«      «      «      ƒ d{  –—†  y7 Œ­wrØ  rÚ  rÛ  s      rJ   rÜ  zAsyncForksSessionResource.start  sA   è ø€ ð ×Ñ×#Ñ#ÜÜ$Ü¨ÀWÐZbÑ cÓdóó
÷ 	
ò 	
úó   ‚:A¼A½Ac          
   ƒ  óŠ   K  — | j                   j                  t        t        t	        d|dœ«      «      «      ƒ d{  –—†  y7 Œ­wrÞ  rÚ  rà  s     rJ   rÁ   zAsyncForksSessionResource.close  s<   è ø€ ð
 ×Ñ×#Ñ#ÜÔ%¤ÀÐ]eÑ7fÓ'gÓhó
÷ 	
ò 	
úó   ‚9A»A¼Ac             ƒ  óŒ   K  — | j                   j                  t        t        t	        d||dœ«      «      «      ƒ d{  –—†  y7 Œ­wrâ  rÚ  rÛ  s      rJ   rã  z AsyncForksSessionResource.update(  sB   è ø€ ð
 ×Ñ×#Ñ#ÜÜ$ÜÐ)9ÀgÐ[cÑ dÓeóó
÷ 	
ò 	
úr#  N)rQ   r  )rQ   r  )rQ   r  )rQ   r!  rä  ræ  rç  rè  rV   rL   rJ   r]   r]     s{   „ ØòEó ðEð òEó ðEð òGó ðGð òCó ðCð `dõ 
ð ?Cõ 
ð cgö 

rL   r]   c                  ó(   — e Zd Zedœ	 	 	 	 	 	 	 dd„Zy)r  rÕ  c             ƒ  óŽ   K  — | j                   j                  t        t        t	        d|||dœ«      «      «      ƒ d{  –—†  y7 Œ­wrë  rÚ  rï  s       rJ   rð  z*AsyncForksSessionCommentaryResource.append6  sJ   è ø€ ð ×Ñ×#Ñ#ÜÜ$Üà ;Ø#*Ø)6Ø$,ñ	óó
ó
÷ 	
ò 	
úó   ‚;A½A¾ANrñ  rò  rV   rL   rJ   r  r  5  ó*   „ à^bñ
Øð
Ø.;ð
ØG[ð
à	ô
rL   r  c                  ó6   — e Zd Zedœdd„Zedœdd„Zedœdd„Zy)r  rÕ  c             ƒ  óŒ   K  — | j                   j                  t        t        t	        d||dœ«      «      «      ƒ d{  –—†  y7 Œ­wrö  rÚ  rø  s      rJ   rð  z*AsyncForksSessionInputAudioResource.appendL  sC   è ø€ ð
 ×Ñ×#Ñ#ÜÜ$ÜÐ)EÐPUÐckÑ lÓmóó
÷ 	
ò 	
úr#  c          
   ƒ  óŠ   K  — | j                   j                  t        t        t	        d|dœ«      «      «      ƒ d{  –—†  y7 Œ­wrú  rÚ  rà  s     rJ   rû  z(AsyncForksSessionInputAudioResource.muteX  s=   è ø€ ð
 ×Ñ×#Ñ#ÜÔ%¤Ð@ZÐhpÑ7qÓ'rÓsó
÷ 	
ò 	
úr%  c          
   ƒ  óŠ   K  — | j                   j                  t        t        t	        d|dœ«      «      «      ƒ d{  –—†  y7 Œ­wrý  rÚ  rà  s     rJ   rþ  z*AsyncForksSessionInputAudioResource.unmutea  s=   è ø€ ð
 ×Ñ×#Ñ#ÜÔ%¤Ð@\ÐjrÑ7sÓ'tÓuó
÷ 	
ò 	
úr%  Nrÿ  ræ  r   rV   rL   rJ   r  r  K  s!   „ ØKOõ 

ð >Bõ 
ð @Dö 
rL   r  c                  ó(   — e Zd Zedœ	 	 	 	 	 	 	 dd„Zy)r  rÕ  c             ƒ  óŽ   K  — | j                   j                  t        t        t	        d|||dœ«      «      «      ƒ d{  –—†  y7 Œ­wr  rÚ  rï  s       rJ   rð  z,AsyncForksSessionInstructionsResource.appendl  sJ   è ø€ ð ×Ñ×#Ñ#ÜÜ$Üà =Ø#*Ø)6Ø$,ñ	óó
ó
÷ 	
ò 	
úr)  Nrñ  rò  rV   rL   rJ   r  r  k  r*  rL   r  c                  ó(   — e Zd Zedœ	 	 	 	 	 	 	 dd„Zy)r!  rÕ  c             ƒ  óŽ   K  — | j                   j                  t        t        t	        d|||dœ«      «      «      ƒ d{  –—†  y7 Œ­wr  rÚ  rï  s       rJ   rð  z(AsyncForksSessionThinkingResource.append‚  sJ   è ø€ ð ×Ñ×#Ñ#ÜÜ$Üà 9Ø#*Ø)6Ø$,ñ	óó
ó
÷ 	
ò 	
úr)  Nrñ  rò  rV   rL   rJ   r!  r!  �  r*  rL   r!  c                  ó,   — e Zd Zedd„«       Zedœdd„Zy)r_   c                ó,   — t        | j                  «      S rè   )ÚAsyncForksResponseItemResourcerb   rœ  s    rJ   r
  zAsyncForksResponseResource.item˜  rË  rL   rÕ  c          
   ƒ  óŠ   K  — | j                   j                  t        t        t	        d|dœ«      «      «      ƒ d{  –—†  y7 Œ­wr  rÚ  rà  s     rJ   r  z!AsyncForksResponseResource.createœ  s=   è ø€ ð ×Ñ×#Ñ#ÜÔ%¤Ð@QÐ_gÑ7hÓ'iÓjó
÷ 	
ò 	
úr%  N)rQ   r5  ræ  r  rV   rL   rJ   r_   r_   —  s"   „ Øò@ó ð@ð @Dö 	
rL   r_   c                  ó   — e Zd Zedœdd„Zy)r5  rÕ  c             ƒ  óŒ   K  — | j                   j                  t        t        t	        d||dœ«      «      «      ƒ d{  –—†  y7 Œ­wr  rÚ  r  s      rJ   r  z%AsyncForksResponseItemResource.create©  sB   è ø€ ð
 ×Ñ×#Ñ#ÜÜ$ÜÐ)?ÈÐ[cÑ dÓeóó
÷ 	
ò 	
úr#  Nr  r  rV   rL   rJ   r5  r5  ¨  s
   „ Ø]aö 

rL   r5  )iÚ
__future__r   rž   r—  rÞ   ÚloggingÚtypesr   Útypingr   r   r   r   r	   r
   r   r   Útyping_extensionsr   rw  Úpydanticr   Ú_typesr   r   r   r   Ú_utilsr   r   r   r   r   Ú_compatr   Ú_modelsr   r   Ú	_resourcer   r   Ú_exceptionsr   r   rs   r    Ú_base_clientr!   Ú_event_handlerr"   Útypes.live.error_eventr#   Útypes.live.fork_client_eventr$   Útypes.live.fork_server_eventr%   Útypes.websocket_reconnectionr&   r'   r(   Ú"types.live.fork_client_event_paramr)   Ú"types.websocket_connection_optionsr*   Ú$types.live.fork_session_config_paramr+   Ú&types.live.session_update_config_paramr,   Ú)types.responses.response_input_item_paramr-   r»  r.   rŒ  Úwebsockets.asyncio.clientra   rG   r/   r0   Ú__all__Ú	getLoggerrS   r3   r!  r1   r2   r[   rY   r‰  rF   rÀ  rŠ  rÉ  rÍ  rÐ  rÓ  r‹  r	  r  r]   r  r  r  r!  r_   r5  rV   rL   rJ   ú<module>rS     s´  ðö #ã Û Û Û Ý ß [× [Ó [Ý +ã Ý ç 0Ó 0ß fÕ fÝ &ß Dß :ß FÝ $Ý +Ý 2Ý 0Ý ;Ý ;ß jÑ jÝ FÝ LÝ JÝ NÝ OáÝNÝVç.à�LÐ
!€à'�g×'Ñ'¨Ó1€€^Ó 1ô
ˆOô 
ô@
Ð!ô 
÷@k!ñ k!÷\	B,ñ B,÷J_ñ _÷D	B&ñ B&÷J&ñ &ô
1
Ð6ô 1
ôh
Ð%@ô 
ô(
Ð%@ô 
ô@
Ð'Bô 
ô(
Ð#>ô 
ô(
Ð7ô 
ô"
Ð ;ô 
÷&ñ &ô
1
Ð @ô 1
ôh
Ð*Jô 
ô,
Ð*Jô 
ô@
Ð,Lô 
ô,
Ð(Hô 
ô,
Ð!Aô 
ô"
Ð%Eõ 
rL   