
    /jS                     |    S SK r S SKrSSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SSKJr  S S	KJr   " S
 S5      rg)    N   )RoomService)EgressService)IngressService)
SipService)AgentDispatchService)ConnectorService)Optionalc                   2   \ rS rSrSr   SSSS.S\\   S\\   S\\   S\\R                     S	\\R                     4
S
 jjjr
\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       rS rS rS rSrg)
LiveKitAPI   zLiveKit Server API Client

This class is the main entrypoint, which exposes all services.

Usage:

```python
from livekit import api
lkapi = api.LiveKitAPI()
rooms = await lkapi.room.list_rooms(api.proto_room.ListRoomsRequest(names=['test-room']))
```
N)timeoutsessionurlapi_key
api_secretr   r   c                   U=(       d    [         R                  " S5      nU=(       d    [         R                  " S5      nU=(       d    [         R                  " S5      nU(       d  [        S5      eU(       a  U(       d  [        S5      eSU l        XPl        U R                  (       d;  SU l        U(       d  [
        R                  " SS	9n[
        R                  " US
9U l        [        U R                  XU5      U l	        [        U R                  XU5      U l        [        U R                  XU5      U l        [        U R                  XU5      U l        [!        U R                  XU5      U l        [%        U R                  XU5      U l        g)a  Create a new LiveKitAPI instance.

Args:
    url: LiveKit server URL (read from `LIVEKIT_URL` environment variable if not provided)
    api_key: API key (read from `LIVEKIT_API_KEY` environment variable if not provided)
    api_secret: API secret (read from `LIVEKIT_API_SECRET` environment variable if not provided)
    timeout: Request timeout (default: 60 seconds)
    session: aiohttp.ClientSession instance to use for requests, if not provided, a new one will be created
LIVEKIT_URLLIVEKIT_API_KEYLIVEKIT_API_SECRETzurl must be setz"api_key and api_secret must be setTF<   )total)r   N)osgetenv
ValueError_custom_session_sessionaiohttpClientTimeoutClientSessionr   _roomr   _ingressr   _egressr   _sipr   _agent_dispatchr	   
_connector)selfr   r   r   r   r   s         H/app/agent/.venv/lib/python3.13/site-packages/livekit/api/livekit_api.py__init__LiveKitAPI.__init__   s   $ -RYY}-9RYY'89B299-A#B
.//jABB#}}#(D !//b9#11'BDM jI
&t}}cJO$T]]C*Mt}}cJG	3DMM3Q[\*4==#
S    returnc                     U R                   $ )z$Instance of the AgentDispatchService)r%   r'   s    r(   agent_dispatchLiveKitAPI.agent_dispatchE   s     ###r+   c                     U R                   $ )zInstance of the RoomService)r!   r.   s    r(   roomLiveKitAPI.roomJ   s     zzr+   c                     U R                   $ )zInstance of the IngressService)r"   r.   s    r(   ingressLiveKitAPI.ingressO   s     }}r+   c                     U R                   $ )zInstance of the EgressService)r#   r.   s    r(   egressLiveKitAPI.egressT   s     ||r+   c                     U R                   $ )zInstance of the SipService)r$   r.   s    r(   sipLiveKitAPI.sipY   s     yyr+   c                     U R                   $ )z Instance of the ConnectorService)r&   r.   s    r(   	connectorLiveKitAPI.connector^   s     r+   c                 x   #    U R                   (       d#  U R                  R                  5       I Sh  vN   gg N7f)ziClose the API client

Call this before your application exits or when the API client is no longer needed.N)r   r   closer.   s    r(   acloseLiveKitAPI.aclosec   s.     
 ##--%%''' $'s   /:8:c                    #    U $ 7f)"@private

Support for `async with` r.   s    r(   
__aenter__LiveKitAPI.__aenter__k   s      s   c                 @   #    U R                  5       I Sh  vN   g N7f)rE   N)rB   )r'   exc_typeexc_valexc_tbs       r(   	__aexit__LiveKitAPI.__aexit__q   s      kkms   )r%   r&   r   r#   r"   r!   r   r$   )NNN)__name__
__module____qualname____firstlineno____doc__r
   strr   r   r    r)   propertyr   r/   r   r2   r   r5   r   r8   r   r;   r	   r>   rB   rG   rM   __static_attributes__rF   r+   r(   r   r      s1    "!%$(	)T 4837)Tc])T #)T SM	)T '//0)T '//0)TV $ 4 $ $ k         Z   +  (r+   r   )r   r   room_servicer   egress_servicer   ingress_servicer   sip_servicer   agent_dispatch_servicer   connector_servicer	   typingr
   r   rF   r+   r(   <module>r^      s,     	 % ) + # 8 / i ir+   