o
    i6                     @   s0  d dl Z d dlmZmZ d dlmZmZ d dlmZ zd dl	m
Z
mZmZmZ dZW n2 ey\   dZeG dd	 d	ZeG d
d deZ
eG dd deZeG dd deZY nw dd ZeG dd dZeG dd deeZeG dd de
eZeG dd deeZeG dd deeZdS )    N)	dataclassfield)AnyOptional)	WebSocket)DailyRunnerArgumentsRunnerArgumentsSmallWebRTCRunnerArgumentsWebSocketRunnerArgumentsTFc                   @   sn   e Zd ZU dZedddZeed< edddZeed< edddZ	e
ed< eeddZee ed	< d
d ZdS )r   zBase class for runner session arguments.

        .. deprecated:: 0.2.2
            Install pipecatcloud[pipecat] for better compatibility. This class
            will be removed in a future release.
        FT)initkw_onlyhandle_siginthandle_sigtermpipeline_idle_timeout_secs)default_factoryr   bodyc                 C   s   d| _ d| _d| _d S )NFi,  )r   r   r   self r   F/home/ubuntu/.local/lib/python3.10/site-packages/pipecatcloud/agent.py__post_init__)   s   
zRunnerArguments.__post_init__N)__name__
__module____qualname____doc__r   r   bool__annotations__r   r   intdictr   r   r   r   r   r   r   r   r      s   
 r   c                   @   s"   e Zd ZU dZeed< eed< dS )r   zFallback Daily runner arguments when pipecat-ai not available.

        .. deprecated:: 0.2.1
            Install pipecatcloud[pipecat] for better compatibility.
        room_urltokenN)r   r   r   r   strr   r   r   r   r   r   .   s   
 r   c                   @      e Zd ZU dZeed< dS )r
   zFallback WebSocket runner arguments when pipecat-ai not available.

        .. deprecated:: 0.2.1
            Install pipecatcloud[pipecat] for better compatibility.
        	websocketN)r   r   r   r   r   r   r   r   r   r   r
   9      
 r
   c                   @   r"   )r	   zFallback Small WebRTC transport session arguments for the runner.

        Parameters:
            webrtc_connection: Pre-configured WebRTC peer connection
        webrtc_connectionN)r   r   r   r   r   r   r   r   r   r   r	   C   r$   r	   c                   C   s   t stjdtdd dS dS )z4Warn users about standalone session arguments usage.zUsing standalone pipecatcloud session arguments without pipecat-ai. For better compatibility, install: pip install pipecatcloud[pipecat]. Standalone mode will be removed in a future release.   )
stacklevelN)_PIPECAT_RUNNER_TYPES_AVAILABLEwarningswarnDeprecationWarningr   r   r   r   _warn_standalone_usageN   s   
r,   c                   @   s   e Zd ZU dZee ed< dS )SessionArgumentsa  Base class for common agent session arguments.

    The arguments are received by the bot() entry point.

    Parameters:
        session_id (Optional[str]): The unique identifier for the session.
            This is used to track the session across requests.
    
session_idN)r   r   r   r   r   r!   r   r   r   r   r   r-   Z   s   
 	r-   c                   @      e Zd ZdZdd ZdS )PipecatSessionArgumentsa  Standard Pipecat Cloud agent session arguments.

    Inherits from RunnerArguments for compatibility with pipecat-ai runner.
    When pipecat-ai is not installed, uses a fallback implementation (deprecated).

    For best compatibility, install: pip install pipecatcloud[pipecat]
    c                 C      t |  t  d S N)r   r   r,   r   r   r   r   r   r      

z%PipecatSessionArguments.__post_init__Nr   r   r   r   r   r   r   r   r   r0   h       r0   c                   @   r/   )DailySessionArgumentsa  Daily based agent session arguments.

    Inherits from DailyRunnerArguments for compatibility with pipecat-ai runner.
    When pipecat-ai is not installed, uses a fallback implementation (deprecated).

    For best compatibility, install: pip install pipecatcloud[pipecat]
    c                 C   r1   r2   )r   r   r,   r   r   r   r   r      r3   z#DailySessionArguments.__post_init__Nr4   r   r   r   r   r6   w   r5   r6   c                   @   r/   )WebSocketSessionArgumentsa  WebSocket based agent session arguments.

    Inherits from WebSocketRunnerArguments for compatibility with pipecat-ai runner.
    When pipecat-ai is not installed, uses a fallback implementation (deprecated).

    For best compatibility, install: pip install pipecatcloud[pipecat]
    c                 C   r1   r2   )r
   r   r,   r   r   r   r   r      r3   z'WebSocketSessionArguments.__post_init__Nr4   r   r   r   r   r7      r5   r7   c                   @   r/   )SmallWebRTCSessionArgumentsa+  SmallWebRTCTransport based agent session arguments.

    Inherits from SmallWebRTCRunnerArguments for compatibility with pipecat-ai runner.
    When pipecat-ai is not installed, uses a fallback implementation (deprecated).

    For best compatibility, install: pip install pipecatcloud[pipecat]
    c                 C   r1   r2   )r	   r   r,   r   r   r   r   r      r3   z)SmallWebRTCSessionArguments.__post_init__Nr4   r   r   r   r   r8      r5   r8   )r)   dataclassesr   r   typingr   r   fastapir   pipecat.runner.typesr   r   r	   r
   r(   ImportErrorr,   r-   r0   r6   r7   r8   r   r   r   r   <module>   s:   
	7