o
    ¨Ýj‚ã  ã                   @  sÄ  U d dl m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( ddl)m*Z* ddl+m,Z,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8 ddl9m:Z: ddl;m<Z< ddl=m>Z>m?Z? ddl@mAZA ddlBmCZCmDZD ddlEmFZF ddlGmHZH ddlImJZJ erçd dlKmLZM d dlNmLZO ddlPmQZQmRZR dd gZSe TeU¡ZVd!eWd"< G d#d„ de%ƒZXG d$d „ d e&ƒZYG d%d&„ d&e6ƒZZG d'd(„ d(ƒZ[G d)d*„ d*e5ƒZ\G d+d,„ d,ƒZ]G d-d.„ d.ƒZ^G d/d0„ d0e^ƒZ_G d1d2„ d2e^ƒZ`G d3d4„ d4e^ƒZaG d5d6„ d6e^ƒZbG d7d8„ d8e^ƒZcG d9d:„ d:e^ƒZdG d;d<„ d<e^ƒZeG d=d>„ d>e^ƒZfG d?d@„ d@e^ƒZgG dAdB„ dBe^ƒZhG dCdD„ dDe^ƒZiG dEdF„ dFƒZjG dGdH„ dHejƒZkG dIdJ„ dJejƒZlG dKdL„ dLejƒZmG dMdN„ dNejƒZnG dOdP„ dPejƒZoG dQdR„ dRejƒZpG dSdT„ dTejƒZqG dUdV„ dVejƒZrG dWdX„ dXejƒZsG dYdZ„ dZejƒZtG d[d\„ d\ejƒZudS )]é    )Ú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)Ú!DEFAULT_LIVE_SEND_QUEUE_MAX_BYTES)Ú decision_item_create_event_param)ÚOpenAIErrorÚWebSocketConnectionClosedError)Ú	SendQueue)Ú_merge_mappings)ÚEventHandlerRegistry)ÚWebSocketConnectionBaseÚAsyncWebSocketConnectionBase)Ú
ErrorEvent)ÚForkClientEvent)ÚForkServerEvent)ÚReconnectingEventÚReconnectingOverrides)ÚForkClientEventParam)ÚWebSocketConnectionOptionsÚSyncWebSocketConnectionOptions)ÚForkSessionConfigParam)ÚSessionUpdateConfigParam)ÚResponseInputItemParam)ÚClientConnection)ÚOpenAIÚAsyncOpenAIÚForksÚ
AsyncForkszlogging.LoggerÚlogc                	   @  ó*   e Zd Zi i i ddddedœddd„ZdS )r4   Né   ç      à?ç       @©Úextra_queryÚextra_headersÚwebsocket_connection_optionsÚon_reconnectingÚmax_retriesÚinitial_delayÚ	max_delayÚmax_queue_sizeÚ
session_idÚstrr<   r   r=   r   r>   r-   r?   úBCallable[[ReconnectingEvent], ReconnectingOverrides | None] | Noner@   ÚintrA   ÚfloatrB   rC   ÚreturnÚForksConnectionManagerc       	   
      C  ó   t | j||||||||	|d�
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@   rA   rB   rC   rD   )rJ   Ú_client©
ÚselfrD   r<   r=   r>   r?   r@   rA   rB   rC   © rQ   úV/var/www/html/chatgpt/venv/lib/python3.10/site-packages/openai/resources/live/forks.pyÚconnect0   ó   özForks.connect)rD   rE   r<   r   r=   r   r>   r-   r?   rF   r@   rG   rA   rH   rB   rH   rC   rG   rI   rJ   ©Ú__name__Ú
__module__Ú__qualname__r   rS   rQ   rQ   rQ   rR   r4   /   ó    õc                	   @  r7   )r5   Nr8   r9   r:   r;   rD   rE   r<   r   r=   r   r>   r,   r?   rF   r@   rG   rA   rH   rB   rC   rI   ÚAsyncForksConnectionManagerc       	   
      C  rK   rL   )rZ   rN   rO   rQ   rQ   rR   rS   P   rT   zAsyncForks.connect)rD   rE   r<   r   r=   r   r>   r,   r?   rF   r@   rG   rA   rH   rB   rH   rC   rG   rI   rZ   rU   rQ   rQ   rQ   rR   r5   O   rY   c                	      óº   e Zd ZU dZded< ded< ded< ded	< d
d
dddi i d
dœdB‡ fd!d"„ZdCd$d%„ZdDd'd(„ZdEd*d+„ZdFd.d/„Z	dGd2d3„Z
	
dHdId9d:„ZdJd<d=„Z	
dHdId>d?„ZdKd@dA„Z‡  ZS )LÚAsyncForksConnectionú7Represents a live WebSocket connection to the Forks APIÚAsyncForksSessionResourceÚsessionÚAsyncForksDecisionResourceÚdecisionÚAsyncForksResponseResourceÚresponseÚAsyncWebSocketConnectionÚ_connectionNr8   r9   r:   ©Úmake_wsr?   r@   rA   rB   r<   r=   Ú
send_queueÚ
connectionrg   úFCallable[[Query, Headers], Awaitable[AsyncWebSocketConnection]] | Noner?   rF   r@   rG   rA   rH   rB   r<   r   r=   r   rh   úSendQueue | NonerI   ÚNonec          
        ó`   t ƒ j|||||||||	d ur|	nttd�td�
 tdd�| _t| ƒ| _t	| ƒ| _
t| ƒ| _d S )N©Z	max_bytes©	rg   r?   r@   rA   rB   r<   r=   rh   ÚloggerF©Zuse_lock)ÚsuperÚ__init__r!   r   r6   r#   Ú_event_handler_registryr^   r_   r`   ra   rb   rc   ©
rP   ri   rg   r?   r@   rA   rB   r<   r=   rh   ©Ú	__class__rQ   rR   rs   x   ó    ö

zAsyncForksConnection.__init__úAsyncIterator[ForkServerEvent]c              
   C s�   �ddl m}m} 	 z
|  ¡ I dH V  W n2 |y   Y dS  |yF } z|  |¡I dH s<| j ¡ }|r;td|d�|‚‚ W Y d}~nd}~ww q
©zq
        An infinite-iterator that will continue to yield events until
        the connection is closed.
        r   )ÚConnectionClosedOKÚConnectionClosedErrorTNz0WebSocket connection closed with unsent messages)Zunsent_messages©Zwebsockets.exceptionsr{   r|   ÚrecvZ
_reconnectÚ_send_queueZdrainr    ©rP   r{   r|   ÚexcZunsentrQ   rQ   rR   Ú	__aiter__—   s,   €
þýù€ÿûzAsyncForksConnection.__aiter__r(   c                 Ã  sb   �|   |  ¡ I dH ¡}ttt|ƒtƒrtd|ƒ d¡nt|ddƒ}t|tƒr/|r/|dkr/d| _	|S )úµ
        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ÚgetattrrE   Ú_reconnect_attempt©rP   ÚeventÚ
event_typerQ   rQ   rR   r~   ­   s   €ÿ
ýzAsyncForksConnection.recvÚbytesc              	   Ã  s”   �| j jdd�I dH }t dt|ƒ¡ | jrHzt |¡}W n tt	fy*   | Y S w t
|tƒr8td|ƒ d¡nd}t
|tƒrH|rH|dkrHd| _|S )	á  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   )re   r~   r6   ÚdebugÚlenr�   ÚjsonÚloadsÚ
ValueErrorÚRecursionErrorrŠ   rŒ   r   r�   rE   )rP   ÚmessageÚ
event_datar’   rQ   rQ   rR   r‰   ¿   s   €ÿzAsyncForksConnection.recv_bytesr‘   ú&ForkClientEvent | ForkClientEventParamc                 Ã  s\   �t |tƒr|jddd�n
t t|tƒI d H ¡}| jr#| j 	|¡ d S | j
 |¡I d H  d S ©NT©Zuse_api_namesZexclude_unset)rŠ   r   Úto_jsonr™   Údumpsr   r+   Ú_is_reconnectingr   Úenqueuere   Úsend©rP   r‘   ÚdatarQ   rQ   rR   r¦   Ô   s   €ÿýzAsyncForksConnection.sendr¨   ústr | bytesc                 C  ó   t ttt |¡t ttƒd�ƒ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   ©rP   r¨   rQ   rQ   rR   rˆ   ß   ó   z AsyncForksConnection.parse_eventr’   rE   ÚhandlerúCallable[..., Any] | NoneúOUnion[AsyncForksConnection, Callable[[Callable[..., Any]], Callable[..., Any]]]c                   ó.   |durˆj  ˆ |¡ ˆS d‡ ‡fd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): ...
        NÚfnúCallable[..., Any]rI   c                   ó   ˆj  ˆ | ¡ | S ©N©rt   Úadd©rµ   ©r’   rP   rQ   rR   Ú	decoratorý   ó   z*AsyncForksConnection.on.<locals>.decorator©rµ   r¶   rI   r¶   r¹   ©rP   r’   r±   r½   rQ   r¼   rR   Úonç   ó
   zAsyncForksConnection.onr¶   c                 C  ó   | j  ||¡ | S ©z-Remove a previously registered event handler.©rt   Úremove©rP   r’   r±   rQ   rQ   rR   Úoff  ó   zAsyncForksConnection.offc                   ó2   |durˆj jˆ |dd� ˆS d	‡ ‡fdd„}|S )
úbRegister a one-time event handler.

        Automatically removed after first invocation.
        NT©Úoncerµ   r¶   rI   c                   ó   ˆj jˆ | dd� | S ©NTrÌ   r¹   r»   r¼   rQ   rR   r½     ó   z,AsyncForksConnection.once.<locals>.decoratorr¿   r¹   rÀ   rQ   r¼   rR   rÍ     ó
   zAsyncForksConnection.oncec                 Ã  s´   �ddl }| 2 zO3 dH W }|j}| j |¡}| j d¡}|dkr0|s0|s0t|tƒr0td|› �ƒ‚|D ]}||ƒ}| |¡rB|I dH  q2|D ]}||ƒ}| |¡rU|I dH  qEq6 dS )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: )Úasyncior…   rt   Úget_handlersrŠ   r&   r   Úiscoroutine)rP   rÓ   r‘   r’   ÚspecificÚgenericr±   ÚresultrQ   rQ   rR   Údispatch_events  s*   €	


€

€ýòz$AsyncForksConnection.dispatch_events)ri   rd   rg   rj   r?   rF   r@   rG   rA   rH   rB   rH   r<   r   r=   r   rh   rk   rI   rl   )rI   ry   ©rI   r(   ©rI   r“   ©r‘   rŸ   rI   rl   ©r¨   r©   rI   r(   r¸   )r’   rE   r±   r²   rI   r³   )r’   rE   r±   r¶   rI   r\   ©rI   rl   )rV   rW   rX   Ú__doc__Ú__annotations__rs   r‚   r~   r‰   r¦   rˆ   rÁ   rÈ   rÍ   rÙ   Ú__classcell__rQ   rQ   rv   rR   r\   o   s4   
 õ




	ÿ
ÿr\   c                   @  ó„   e Zd ZdZddddedœd=dd„Zd>dd „Z	d?d@d%d&„ZdAd(d)„Z	d?d@d*d+„Z	dBd-d.„Z
e
ZdCd0d1„ZdDd3d4„ZdEd;d<„ZdS )FrZ   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()
    ```
    Nr8   r9   r:   ©r?   r@   rA   rB   rC   rM   r3   rD   rE   r<   r   r=   r   r>   r,   r?   rF   r@   rG   rA   rH   rB   rC   rI   rl   c       
         C  óX   || _ || _d | _|| _|| _|| _|| _|| _|| _|	| _	t
|
d�| _tdd�| _d S )Nrn   Frq   )Ú$_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©rP   rM   rD   r<   r=   r>   r?   r@   rA   rB   rC   rQ   rQ   rR   rs   L  ó   z$AsyncForksConnectionManager.__init__r‘   rŸ   c                 C  ó8   t |tƒr|jddd�nt t|tƒ¡}| j |¡ dS ©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ï   r¥   r§   rQ   rQ   rR   r¦   g  ó
   ÿýz AsyncForksConnectionManager.sendr’   r±   r²   úVUnion[AsyncForksConnectionManager, Callable[[Callable[..., Any]], Callable[..., Any]]]c                   r´   )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``.
        Nrµ   r¶   rI   c                   r·   r¸   ©rð   rº   r»   r¼   rQ   rR   r½   €  r¾   z1AsyncForksConnectionManager.on.<locals>.decoratorr¿   r÷   rÀ   rQ   r¼   rR   rÁ   t  ó
   zAsyncForksConnectionManager.onr¶   c                 C  rÃ   rÄ   )rð   rÆ   rÇ   rQ   rQ   rR   rÈ   †  rÉ   zAsyncForksConnectionManager.offc                   rÊ   )
úGRegister a one-time event handler before the connection is established.NTrÌ   rµ   r¶   rI   c                   rÎ   rÏ   r÷   r»   r¼   rQ   rR   r½   “  rÐ   z3AsyncForksConnectionManager.once.<locals>.decoratorr¿   r÷   rÀ   rQ   r¼   rR   rÍ   ‹  ó
   z AsyncForksConnectionManager.oncer\   c                 Ã  s¶   �|   | j| j¡I dH }z1t|| jdur| j nd| j| j| j| j| j| j| jd�	| _	| j
 | j	j¡ | j	 ¡ I dH  W | j	S  tyZ   d| _	z	| ¡ I dH  W ‚  tyY   Y ‚ w 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()
        ```
        Nrf   )Ú_connect_wsrè   ré   r\   rë   rì   rí   rî   rï   rç   rð   Ú
merge_intort   Ú_flush_send_queueÚBaseExceptionÚclose©rP   ÚwsrQ   rQ   rR   Ú
__aenter__™  s6   €÷
÷ýýüz&AsyncForksConnectionManager.__aenter__rd   c           
   
   Ã  s°  �zddl m} W n ty } ztdƒ|‚d }~ww |  ¡ }zt| jdƒ}W n ty4   | jj}Y nw |j	|||ƒd�}|j	dddœ 
|j|j¡d	�}| j tjd
t|ƒt|ƒddid�¡I d H }| j |j¡ | jj tt|jƒ¡¡}|j	dddœ 
|j|j¡d	�}dd„ | jji | jjt|jƒr—|jni fD ƒ}t d¡ | jr©t d¡ | j ¡ }	|	  dd ¡ |	 
d¡d u rÁ|	  dd ¡ |t|ƒfd t!t| "¡ ƒi ƒdœ|	¤ŽI d H S )Nr   )Ú_WebSocketConnectú9You need to install `openai[realtime]` to use this methodÚ_websocket_query_params©Úparamsr  Úwss©ÚhttpÚhttps©Úschemer�   Úbearer_authT©ÚmethodÚurlÚheadersÚsecurityc                 S  ó,   i | ]}|  ¡ D ]\}}| ¡ ||f“qqS rQ   ©ÚitemsÚlower©Ú.0Z
header_setÚkeyr¬   rQ   rQ   rR   Ú
<dictcomp>ã  ó    øùÿz;AsyncForksConnectionManager._connect_ws.<locals>.<dictcomp>úConnecting to WebSocket APIú,Custom WebSocket connection options providedÚmax_sizeÚcompression©Zuser_agent_headerZadditional_headers)#Úlib._websocketr  ÚImportErrorr   Ú_prepare_urlrŽ   rå   ÚAttributeErrorÚ _websocket_query_params_fallbackÚ	copy_withr�   r  Ú_prepare_optionsr   Ú	constructrE   rŒ   r  Úcopy_merge_paramsÚqsÚ	stringifyr   r   r  Úauth_headersÚdefault_headersr   r  r6   r—   rê   ÚcopyÚ
setdefaultr"   Úvalues©
rP   r<   r=   rS   r�   r  Zquery_paramsÚoptionsr  Zwebsocket_optionsrQ   rQ   rR   rû   Ä  sl   €
€ÿÿþÿü
ÿÿüþ



ÿýüz'AsyncForksConnectionManager._connect_wsú
httpx2.URLc                 C  óŠ   | j jd urt | j j¡}n| j jj}|dkrdnd}| j jj|d�}|j d¡\}}}| 	d¡t
d| jd� d	¡ | | }|j|d
�S ©Nr
  r  r  r  ó   ?ó   /z /live/sessions/{session_id}/fork)rD   zutf-8)Úraw_path)rå   Úwebsocket_base_urlÚhttpx2ÚURLÚ	_base_urlr  r'  r9  Ú	partitionÚrstripr   ræ   Úencode©rP   Úbase_urlr  Z	ws_schemeÚpathÚ	separatorÚqueryZmerge_raw_pathrQ   rQ   rR   r$  ý  ó   
ÿþýÿz(AsyncForksConnectionManager._prepare_urlÚexc_typeútype[BaseException] | Noner�   úBaseException | NoneÚexc_tbúTracebackType | Nonec                 Ã  s$   �| j d ur| j  ¡ I d H  d S d S r¸   )rç   rÿ   ©rP   rG  r�   rJ  rQ   rQ   rR   Ú	__aexit__  s   €
ÿz%AsyncForksConnectionManager.__aexit__)rM   r3   rD   rE   r<   r   r=   r   r>   r,   r?   rF   r@   rG   rA   rH   rB   rH   rC   rG   rI   rl   rÜ   r¸   )r’   rE   r±   r²   rI   rö   )r’   rE   r±   r¶   rI   rZ   )rI   r\   )r<   r   r=   r   rI   rd   ©rI   r4  ©rG  rH  r�   rI  rJ  rK  rI   rl   )rV   rW   rX   rß   r   rs   r¦   rÁ   rÈ   rÍ   r  Úenterrû   r$  rM  rQ   rQ   rQ   rR   rZ   8  ó&    ô
ÿ
ÿ
)

9rZ   c                	      r[   )LÚForksConnectionr]   ÚForksSessionResourcer_   ÚForksDecisionResourcera   ÚForksResponseResourcerc   ÚWebSocketConnectionre   Nr8   r9   r:   rf   ri   rg   ú6Callable[[Query, Headers], WebSocketConnection] | Noner?   rF   r@   rG   rA   rH   rB   r<   r   r=   r   rh   rk   rI   rl   c          
        rm   )Nrn   ro   Trq   )rr   rs   r!   r   r6   r#   rt   rS  r_   rT  ra   rU  rc   ru   rv   rQ   rR   rs     rx   zForksConnection.__init__úIterator[ForkServerEvent]c              
   c  s„   � ddl m}m} 	 z|  ¡ V  W n/ |y   Y dS  |y@ } z|  |¡s6| j ¡ }|r5td|d�|‚‚ W Y d}~nd}~ww q
rz   r}   r€   rQ   rQ   rR   Ú__iter__=  s,   €

þýù€ÿûzForksConnection.__iter__r(   c                 C  sZ   |   |  ¡ ¡}ttt|ƒtƒrtd|ƒ d¡nt|ddƒ}t|tƒr+|r+|dkr+d| _	|S )rƒ   r„   r…   Nr†   r   r‡   r�   rQ   rQ   rR   r~   S  s   ÿ
ýzForksConnection.recvr“   c              	   C  s”   ddl m} || jƒ}t dt|ƒ¡ | jrHzt |¡}W n t	t
fy*   | Y S w t|tƒr8td|ƒ d¡nd}t|tƒrH|rH|dkrHd| _|S )	r”   r   )Ú_recv_bytesr–   r„   r…   Nr†   r   )r"  rZ  re   r6   r—   r˜   r�   r™   rš   r›   rœ   rŠ   rŒ   r   r�   rE   )rP   rZ  r�   rž   r’   rQ   rQ   rR   r‰   e  s   
ÿzForksConnection.recv_bytesr‘   rŸ   c                 C  sN   t |tƒr|jddd�nt t|tƒ¡}| jr| j 	|¡ d S | j
 |¡ d S r    )rŠ   r   r¢   r™   r£   r   r+   r¤   r   r¥   re   r¦   r§   rQ   rQ   rR   r¦   |  s   ÿýzForksConnection.sendr¨   r©   c                 C  rª   r«   r®   r¯   rQ   rQ   rR   rˆ   ‡  r°   zForksConnection.parse_eventr’   rE   r±   r²   úJUnion[ForksConnection, Callable[[Callable[..., Any]], Callable[..., Any]]]c                   r´   )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): ...
        Nrµ   r¶   rI   c                   r·   r¸   r¹   r»   r¼   rQ   rR   r½   ¥  r¾   z%ForksConnection.on.<locals>.decoratorr¿   r¹   rÀ   rQ   r¼   rR   rÁ   �  rÂ   zForksConnection.onr¶   c                 C  rÃ   rÄ   rÅ   rÇ   rQ   rQ   rR   rÈ   «  rÉ   zForksConnection.offc                   rÊ   )
rË   NTrÌ   rµ   r¶   rI   c                   rÎ   rÏ   r¹   r»   r¼   rQ   rR   r½   »  rÐ   z'ForksConnection.once.<locals>.decoratorr¿   r¹   rÀ   rQ   r¼   rR   rÍ   °  rÑ   zForksConnection.oncec                 C  sx   | D ]7}|j }| j |¡}| j d¡}|dkr'|s'|s't|tƒr'td|› �ƒ‚|D ]}||ƒ q)|D ]}||ƒ q2qdS )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   )rP   r‘   r’   rÖ   r×   r±   rQ   rQ   rR   rÙ   Á  s   	


ÿôzForksConnection.dispatch_events)ri   rV  rg   rW  r?   rF   r@   rG   rA   rH   rB   rH   r<   r   r=   r   rh   rk   rI   rl   )rI   rX  rÚ   rÛ   rÜ   rÝ   r¸   )r’   rE   r±   r²   rI   r[  )r’   rE   r±   r¶   rI   rR  rÞ   )rV   rW   rX   rß   rà   rs   rY  r~   r‰   r¦   rˆ   rÁ   rÈ   rÍ   rÙ   rá   rQ   rQ   rv   rR   rR    s4   
 õ




	ÿ
ÿrR  c                   @  râ   )FrJ   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()
    ```
    Nr8   r9   r:   rã   rM   r2   rD   rE   r<   r   r=   r   r>   r-   r?   rF   r@   rG   rA   rH   rB   rC   rI   rl   c       
         C  rä   )Nrn   Trq   )Ú_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_registryrñ   rQ   rQ   rR   rs   î  rò   zForksConnectionManager.__init__r‘   rŸ   c                 C  ró   rô   )	rŠ   r   r¢   r™   r£   r   r+   rf  r¥   r§   rQ   rQ   rR   r¦   	  rõ   zForksConnectionManager.sendr’   r±   r²   úQUnion[ForksConnectionManager, Callable[[Callable[..., Any]], Callable[..., Any]]]c                   r´   )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``.
        Nrµ   r¶   rI   c                   r·   r¸   ©rg  rº   r»   r¼   rQ   rR   r½   "  r¾   z,ForksConnectionManager.on.<locals>.decoratorr¿   ri  rÀ   rQ   r¼   rR   rÁ     rø   zForksConnectionManager.onr¶   c                 C  rÃ   rÄ   )rg  rÆ   rÇ   rQ   rQ   rR   rÈ   (  rÉ   zForksConnectionManager.offc                   rÊ   )
rù   NTrÌ   rµ   r¶   rI   c                   rÎ   rÏ   ri  r»   r¼   rQ   rR   r½   5  rÐ   z.ForksConnectionManager.once.<locals>.decoratorr¿   ri  rÀ   rQ   r¼   rR   rÍ   -  rú   zForksConnectionManager.oncerR  c                 C  s¢   |   | j| j¡}z.t|| jdur| j nd| j| j| j| j| j| j| jd�	| _	| j
 | j	j¡ | j	 ¡  W | j	S  tyP   d| _	z| ¡  W ‚  tyO   Y ‚ w w )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()
        ```
        Nrf   )rû   r_  r`  rR  rb  rc  rd  re  rf  r^  rg  rü   rt   rý   rþ   rÿ   r   rQ   rQ   rR   Ú	__enter__;  s4   ÷
÷
ýýüz ForksConnectionManager.__enter__rV  c           
   
   C  s¢  zddl m} W n ty } ztdƒ|‚d }~ww |  ¡ }zt| jdƒ}W n ty3   | jj}Y nw |j	|||ƒd�}|j	dddœ 
|j|j¡d	�}| j tjd
t|ƒt|ƒddid�¡}| j |j¡ | jj tt|jƒ¡¡}|j	dddœ 
|j|j¡d	�}dd„ | jji | jjt|jƒr“|jni fD ƒ}t d¡ | jr¥t d¡ | j ¡ }	|	  dd ¡ |	 
d¡d u r½|	  dd ¡ |t|ƒfd t!t| "¡ ƒi ƒdœ|	¤ŽS )Nr   )rS   r  r  r  r  r  r	  r  r�   r  Tr  c                 S  r  rQ   r  r  rQ   rQ   rR   r  …  r  z6ForksConnectionManager._connect_ws.<locals>.<dictcomp>r  r  r  r   r!  )#Úwebsockets.sync.clientrS   r#  r   r$  rŽ   r\  r%  r&  r'  r�   r  r(  r   r)  rE   rŒ   r  r*  r+  r,  r   r   r  r-  r.  r   r  r6   r—   ra  r/  r0  r"   r1  r2  rQ   rQ   rR   rû   f  sj   
€ÿÿþÿüÿÿüþ



ÿýüz"ForksConnectionManager._connect_wsr4  c                 C  r5  r6  )r\  r:  r;  r<  r=  r  r'  r9  r>  r?  r   r]  r@  rA  rQ   rQ   rR   r$  Ÿ  rF  z#ForksConnectionManager._prepare_urlrG  rH  r�   rI  rJ  rK  c                 C  s   | j d ur| j  ¡  d S d S r¸   )r^  rÿ   rL  rQ   rQ   rR   Ú__exit__°  s   
ÿzForksConnectionManager.__exit__)rM   r2   rD   rE   r<   r   r=   r   r>   r-   r?   rF   r@   rG   rA   rH   rB   rH   rC   rG   rI   rl   rÜ   r¸   )r’   rE   r±   r²   rI   rh  )r’   rE   r±   r¶   rI   rJ   )rI   rR  )r<   r   r=   r   rI   rV  rN  rO  )rV   rW   rX   rß   r   rs   r¦   rÁ   rÈ   rÍ   rj  rP  rû   r$  rl  rQ   rQ   rQ   rR   rJ   Ú  rQ  rJ   c                   @  ó   e Zd Zddd„ZdS )	ÚBaseForksConnectionResourceri   rR  rI   rl   c                 C  ó
   || _ d S r¸   ©re   ©rP   ri   rQ   rQ   rR   rs   ¸  ó   
z$BaseForksConnectionResource.__init__N)ri   rR  rI   rl   ©rV   rW   rX   rs   rQ   rQ   rQ   rR   rn  ·  ó    rn  c                   @  ó‚   e Zd Zeddd„ƒZed dd„ƒZed!d	d
„ƒZed"dd„ƒZed#dd„ƒZe	dœd$dd„Z
e	dœd%dd„Ze	dœd&dd„ZdS )'rS  rI   ÚForksSessionCommentaryResourcec                 C  ó
   t | jƒS r¸   )rv  re   ©rP   rQ   rQ   rR   Ú
commentary½  ó   
zForksSessionResource.commentaryÚForksSessionInputAudioResourcec                 C  rw  r¸   )r{  re   rx  rQ   rQ   rR   Úinput_audioÁ  rz  z ForksSessionResource.input_audioÚ ForksSessionInstructionsResourcec                 C  rw  r¸   )r}  re   rx  rQ   rQ   rR   ÚinstructionsÅ  rz  z!ForksSessionResource.instructionsÚForksSessionOutputAudioResourcec                 C  rw  r¸   )r  re   rx  rQ   rQ   rR   Úoutput_audioÉ  rz  z!ForksSessionResource.output_audioÚForksSessionThinkingResourcec                 C  rw  r¸   )r�  re   rx  rQ   rQ   rR   ÚthinkingÍ  rz  zForksSessionResource.thinking©Úevent_idr_   r.   r„  úOptional[str] | Omitrl   c             	   C  ó"   | j  tttd||dœƒƒ¡ dS ©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©re   r¦   r   r+   r   ©rP   r_   r„  rQ   rQ   rR   ÚstartÑ  ó   þÿzForksSessionResource.startc                C  ó    | j  tttd|dœƒƒ¡ dS ©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‰  ©rP   r„  rQ   rQ   rR   rÿ   Þ  ó   ÿzForksSessionResource.closer/   c             	   C  r†  ©z¬
        Update the delegation settings or transcript triggers of an active Live session.

        The server acknowledges accepted changes with `session.updated`.
        zsession.updaterˆ  Nr‰  rŠ  rQ   rQ   rR   Úupdateç  rŒ  zForksSessionResource.updateN)rI   rv  )rI   r{  )rI   r}  )rI   r  )rI   r�  ©r_   r.   r„  r…  rI   rl   ©r„  r…  rI   rl   ©r_   r/   r„  r…  rI   rl   ©rV   rW   rX   r   ry  r|  r~  r€  r‚  r   r‹  rÿ   r“  rQ   rQ   rQ   rR   rS  ¼  ó    	rS  c                   @  ó   e Zd Zedœdd
d„ZdS )rv  rƒ  ÚcontentrE   Údelegation_idúOptional[str]r„  r…  rI   rl   c             
   C  ó$   | j  tttd|||dœƒƒ¡ dS ©z·
        Provide context the Live model can communicate to the user, optionally for an
        existing client delegation.

        Rejected while an audio fixture is active.
        zsession.commentary.append©r…   rš  r›  r„  Nr‰  ©rP   rš  r›  r„  rQ   rQ   rR   Úappendö  ó   üÿþÿz%ForksSessionCommentaryResource.appendN©rš  rE   r›  rœ  r„  r…  rI   rl   ©rV   rW   rX   r   r¡  rQ   rQ   rQ   rR   rv  õ  ó    rv  c                   @  ó<   e Zd Zedœddd	„Zedœdd
d„Zedœddd„ZdS )r{  rƒ  ÚaudiorE   r„  r…  rI   rl   c             	   C  r†  ©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…   r§  r„  Nr‰  ©rP   r§  r„  rQ   rQ   rR   r¡    ó   þÿz%ForksSessionInputAudioResource.appendc                C  r�  ©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�  rQ   rQ   rR   Úmute  r‘  z#ForksSessionInputAudioResource.mutec                C  r�  ©zÉResume audio input to a Live model after muting it.

        The server acknowledges with `session.input_audio.unmuted`. An active audio fixture still pauses inference until playback finishes.
        zsession.input_audio.unmuter�  Nr‰  r�  rQ   rQ   rR   Úunmute"  r‘  z%ForksSessionInputAudioResource.unmuteN©r§  rE   r„  r…  rI   rl   r•  ©rV   rW   rX   r   r¡  r­  r¯  rQ   rQ   rQ   rR   r{    ó    	r{  c                   @  r™  )r}  rƒ  rš  rE   r›  rœ  r„  r…  rI   rl   c             
   C  r�  ©a¡  Append developer instructions to the Live conversation while it is running,
        optionally associating them with an existing client delegation.

        Rejected while an audio fixture is active. These instructions remain in conversation history through compaction and are included in future backend delegations. For external audio, describe content already delivered so the assistant does not repeat it.
        zsession.instructions.appendrŸ  Nr‰  r   rQ   rQ   rR   r¡  -  s   üÿþÿz'ForksSessionInstructionsResource.appendNr£  r¤  rQ   rQ   rQ   rR   r}  ,  r¥  r}  c                   @  ó   e Zd Zeddd„ƒZdS )r  rI   Ú&ForksSessionOutputAudioFixtureResourcec                 C  rw  r¸   )rµ  re   rx  rQ   rQ   rR   ÚfixtureC  rz  z'ForksSessionOutputAudioResource.fixtureN)rI   rµ  ©rV   rW   rX   r   r¶  rQ   rQ   rQ   rR   r  B  ó    r  c                   @  r™  )r�  rƒ  rš  rE   r›  rœ  r„  r…  rI   rl   c             
   C  r�  ©z»
        Provide silent reasoning or progress context to the Live model, optionally for
        an existing client delegation.

        Rejected while an audio fixture is active.
        zsession.thinking.appendrŸ  Nr‰  r   rQ   rQ   rR   r¡  I  r¢  z#ForksSessionThinkingResource.appendNr£  r¤  rQ   rQ   rQ   rR   r�  H  r¥  r�  c                   @  ó   e Zd Zedœddd	„Zd
S )rµ  rƒ  r§  rE   r„  r…  rI   rl   c             	   C  r†  ©aL  Play one complete audio fixture through the session output.

        Send this event over the primary WebSocket or a server sideband. Audio must be raw mono PCM16 little-endian at 24 kHz, regardless of the session audio format, and at most 30 seconds. The entire payload is validated before model speech is interrupted and input is muted. Only one fixture can be active. fixture.playing acknowledges acceptance and fixture.played reports server mixer drain. These notifications are not exact transport-media boundaries. Input arriving during playback is dropped and not replayed.
        z!session.output_audio.fixture.playr©  Nr‰  rª  rQ   rQ   rR   Úplay`  r«  z+ForksSessionOutputAudioFixtureResource.playNr°  ©rV   rW   rX   r   r¼  rQ   rQ   rQ   rR   rµ  _  r¥  rµ  c                   @  ó$   e Zd Zeddd„ƒZddd	„Zd
S )rT  rI   ÚForksDecisionItemResourcec                 C  rw  r¸   )r¿  re   rx  rQ   rQ   rR   Úitemn  rz  zForksDecisionResource.itemr„  rE   rl   c                C  s   | j  d|dœ¡ dS ©z¹
        Evaluate the configured questions using the current conversation and Decision
        inputs.

        Reusing an event_id is rejected for the lifetime of the session.
        zdecision.creater�  N©re   r¦   r�  rQ   rQ   rR   Úcreater  s   zForksDecisionResource.createN)rI   r¿  ©r„  rE   rI   rl   ©rV   rW   rX   r   rÀ  rÃ  rQ   rQ   rQ   rR   rT  m  ó    rT  c                   @  ó*   e Zd Zeddd„ƒZedœdd	d
„ZdS )rU  rI   ÚForksResponseItemResourcec                 C  rw  r¸   )rÈ  re   rx  rQ   rQ   rR   rÀ  }  rz  zForksResponseResource.itemrƒ  r„  r…  rl   c                C  r�  ©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�  rQ   rQ   rR   rÃ  �  s   ÿzForksResponseResource.createN)rI   rÈ  r•  ©rV   rW   rX   r   rÀ  r   rÃ  rQ   rQ   rQ   rR   rU  |  ó    rU  c                   @  ó,   e Zd Zedœddd	„Zedœddd„ZdS )r¿  rƒ  Úitem_idrE   r„  r…  rI   rl   c             	   C  r†  ©z{
        Delete an input item from future decisions without starting an evaluation or changing Live voice context.
        zdecision.item.delete)r…   rÍ  r„  Nr‰  ©rP   rÍ  r„  rQ   rQ   rR   ÚdeleteŽ  ó   þÿz ForksDecisionItemResource.deleterÀ  ú%decision_item_create_event_param.Itemc             	   C  r†  ©zz
        Append an input item for future decisions without starting an evaluation or changing Live voice context.
        zdecision.item.create©r…   rÀ  r„  Nr‰  ©rP   rÀ  r„  rQ   rQ   rR   rÃ  ™  rÑ  z ForksDecisionItemResource.createN©rÍ  rE   r„  r…  rI   rl   ©rÀ  rÒ  r„  r…  rI   rl   ©rV   rW   rX   r   rÐ  rÃ  rQ   rQ   rQ   rR   r¿  �  s    r¿  c                   @  rº  )rÈ  rƒ  rÀ  r0   r„  r…  rI   rl   c             	   C  r†  ©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.createrÔ  Nr‰  rÕ  rQ   rQ   rR   rÃ  ¦  r«  z ForksResponseItemResource.createN©rÀ  r0   r„  r…  rI   rl   ©rV   rW   rX   r   rÃ  rQ   rQ   rQ   rR   rÈ  ¥  r¥  rÈ  c                   @  rm  )	Ú BaseAsyncForksConnectionResourceri   r\   rI   rl   c                 C  ro  r¸   rp  rq  rQ   rQ   rR   rs   ´  rr  z)BaseAsyncForksConnectionResource.__init__N)ri   r\   rI   rl   rs  rQ   rQ   rQ   rR   rÜ  ³  rt  rÜ  c                   @  ru  )'r^   rI   Ú#AsyncForksSessionCommentaryResourcec                 C  rw  r¸   )rÝ  re   rx  rQ   rQ   rR   ry  ¹  rz  z$AsyncForksSessionResource.commentaryÚ#AsyncForksSessionInputAudioResourcec                 C  rw  r¸   )rÞ  re   rx  rQ   rQ   rR   r|  ½  rz  z%AsyncForksSessionResource.input_audioÚ%AsyncForksSessionInstructionsResourcec                 C  rw  r¸   )rß  re   rx  rQ   rQ   rR   r~  Á  rz  z&AsyncForksSessionResource.instructionsÚ$AsyncForksSessionOutputAudioResourcec                 C  rw  r¸   )rà  re   rx  rQ   rQ   rR   r€  Å  rz  z&AsyncForksSessionResource.output_audioÚ!AsyncForksSessionThinkingResourcec                 C  rw  r¸   )rá  re   rx  rQ   rQ   rR   r‚  É  rz  z"AsyncForksSessionResource.thinkingrƒ  r_   r.   r„  r…  rl   c             	   Ã  ó*   �| j  tttd||dœƒƒ¡I dH  dS r‡  r‰  rŠ  rQ   rQ   rR   r‹  Í  ó   €þÿzAsyncForksSessionResource.startc                Ã  ó(   �| j  tttd|dœƒƒ¡I dH  dS rŽ  r‰  r�  rQ   rQ   rR   rÿ   Ú  ó   €ÿzAsyncForksSessionResource.closer/   c             	   Ã  râ  r’  r‰  rŠ  rQ   rQ   rR   r“  ã  rã  z AsyncForksSessionResource.updateN)rI   rÝ  )rI   rÞ  )rI   rß  )rI   rà  )rI   rá  r”  r•  r–  r—  rQ   rQ   rQ   rR   r^   ¸  r˜  r^   c                   @  r™  )rÝ  rƒ  rš  rE   r›  rœ  r„  r…  rI   rl   c             
   Ã  ó,   �| j  tttd|||dœƒƒ¡I dH  dS rž  r‰  r   rQ   rQ   rR   r¡  ò  ó   €	üÿþÿz*AsyncForksSessionCommentaryResource.appendNr£  r¤  rQ   rQ   rQ   rR   rÝ  ñ  ó    ÿrÝ  c                   @  r¦  )rÞ  rƒ  r§  rE   r„  r…  rI   rl   c             	   Ã  râ  r¨  r‰  rª  rQ   rQ   rR   r¡    ó   €þÿz*AsyncForksSessionInputAudioResource.appendc                Ã  rä  r¬  r‰  r�  rQ   rQ   rR   r­    rå  z(AsyncForksSessionInputAudioResource.mutec                Ã  rä  r®  r‰  r�  rQ   rQ   rR   r¯     rå  z*AsyncForksSessionInputAudioResource.unmuteNr°  r•  r±  rQ   rQ   rQ   rR   rÞ  
  r²  rÞ  c                   @  r™  )rß  rƒ  rš  rE   r›  rœ  r„  r…  rI   rl   c             
   Ã  ræ  r³  r‰  r   rQ   rQ   rR   r¡  +  s   €üÿþÿz,AsyncForksSessionInstructionsResource.appendNr£  r¤  rQ   rQ   rQ   rR   rß  *  rè  rß  c                   @  r´  )rà  rI   Ú+AsyncForksSessionOutputAudioFixtureResourcec                 C  rw  r¸   )rê  re   rx  rQ   rQ   rR   r¶  C  rz  z,AsyncForksSessionOutputAudioResource.fixtureN)rI   rê  r·  rQ   rQ   rQ   rR   rà  B  r¸  rà  c                   @  r™  )rá  rƒ  rš  rE   r›  rœ  r„  r…  rI   rl   c             
   Ã  ræ  r¹  r‰  r   rQ   rQ   rR   r¡  I  rç  z(AsyncForksSessionThinkingResource.appendNr£  r¤  rQ   rQ   rQ   rR   rá  H  rè  rá  c                   @  rº  )rê  rƒ  r§  rE   r„  r…  rI   rl   c             	   Ã  râ  r»  r‰  rª  rQ   rQ   rR   r¼  b  ré  z0AsyncForksSessionOutputAudioFixtureResource.playNr°  r½  rQ   rQ   rQ   rR   rê  a  r¥  rê  c                   @  r¾  )r`   rI   ÚAsyncForksDecisionItemResourcec                 C  rw  r¸   )rë  re   rx  rQ   rQ   rR   rÀ  p  rz  zAsyncForksDecisionResource.itemr„  rE   rl   c                Ã  s   �| j  d|dœ¡I dH  dS rÁ  rÂ  r�  rQ   rQ   rR   rÃ  t  s   €z!AsyncForksDecisionResource.createN)rI   rë  rÄ  rÅ  rQ   rQ   rQ   rR   r`   o  rÆ  r`   c                   @  rÇ  )rb   rI   ÚAsyncForksResponseItemResourcec                 C  rw  r¸   )rì  re   rx  rQ   rQ   rR   rÀ    rz  zAsyncForksResponseResource.itemrƒ  r„  r…  rl   c                Ã  rä  rÉ  r‰  r�  rQ   rQ   rR   rÃ  ƒ  s   €ÿz!AsyncForksResponseResource.createN)rI   rì  r•  rÊ  rQ   rQ   rQ   rR   rb   ~  rË  rb   c                   @  rÌ  )rë  rƒ  rÍ  rE   r„  r…  rI   rl   c             	   Ã  râ  rÎ  r‰  rÏ  rQ   rQ   rR   rÐ  �  s   €þÿz%AsyncForksDecisionItemResource.deleterÀ  rÒ  c             	   Ã  râ  rÓ  r‰  rÕ  rQ   rQ   rR   rÃ  ›  rã  z%AsyncForksDecisionItemResource.createNrÖ  r×  rØ  rQ   rQ   rQ   rR   rë  �  s    ÿrë  c                   @  rº  )rì  rƒ  rÀ  r0   r„  r…  rI   rl   c             	   Ã  râ  rÙ  r‰  rÕ  rQ   rQ   rR   rÃ  ª  ré  z%AsyncForksResponseItemResource.createNrÚ  rÛ  rQ   rQ   rQ   rR   rì  ©  r¥  rì  )vÚ
__future__r   r™   ÚloggingÚtypesr   Útypingr   r   r   r   r   r	   r
   r   Ztyping_extensionsr   r;  Zpydanticr   Ú_typesr   r   r   r   Z_utilsr   r   r   r   r   Z_compatr   Z_modelsr   r   Z	_resourcer   r   Ú
_constantsr   Z
types.liver   Ú_exceptionsr   r    r   r!   Z_base_clientr"   Z_event_handlerr#   Z_websocket_connectionr$   r%   Ztypes.live.error_eventr&   Ztypes.live.fork_client_eventr'   Ztypes.live.fork_server_eventr(   Ztypes.websocket_reconnectionr)   r*   Z"types.live.fork_client_event_paramr+   Z"types.websocket_connection_optionsr,   r-   Z$types.live.fork_session_config_paramr.   Z&types.live.session_update_config_paramr/   Z)types.responses.response_input_item_paramr0   rk  r1   rV  Zwebsockets.asyncio.clientrd   rN   r2   r3   Ú__all__Ú	getLoggerrV   r6   rà   r4   r5   r\   rZ   rR  rJ   rn  rS  rv  r{  r}  r  r�  rµ  rT  rU  r¿  rÈ  rÜ  r^   rÝ  rÞ  rß  rà  rá  rê  r`   rb   rë  rì  rQ   rQ   rQ   rR   Ú<module>   sŠ   (   J ^ F ^9 9 