o
    Ã¿iç  ã                   @   sP   d Z ddlmZmZ ddlmZ ddlmZ G dd„ deƒZG dd„ deƒZ	d	S )
zoBase API for HeyGen avatar services.

Base class defining the common interface for HeyGen avatar service APIs.
é    )ÚABCÚabstractmethod)ÚAny)Ú	BaseModelc                   @   sJ   e Zd ZU dZeed< eed< eed< dZeed< dZeed< eed< dS )	ÚStandardSessionResponseuB  Standardized session response that all HeyGen avatar services will provide.

    This contains the common fields that the client needs to operate,
    while also storing the raw response for service-specific data access.

    Parameters:
        session_id (str): Unique identifier for the streaming session.
        access_token (str): Token for accessing the session securely.
        livekit_agent_token (str): Token for HeyGenâ€™s audio agents(Pipecat).
        ws_url (str): WebSocket URL for the session.
        livekit_url (str): LiveKit server URL for the session.
    Ú
session_idÚaccess_tokenÚlivekit_agent_tokenNÚlivekit_urlÚws_urlÚraw_response)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚstrÚ__annotations__r
   r   r   © r   r   úT/home/ubuntu/.local/lib/python3.10/site-packages/pipecat/services/heygen/base_api.pyr      s   
 r   c                   @   s<   e Zd ZdZededefdd„ƒZededefdd„ƒZ	d	S )
ÚBaseAvatarApiz#Base class for avatar service APIs.Úrequest_dataÚreturnc                 Ã   ó   dS )zÌCreate a new avatar session.

        Args:
            request_data: Service-specific session request data

        Returns:
            StandardSessionResponse: Standardized session information
        Nr   )Úselfr   r   r   r   Únew_session-   ó   €
zBaseAvatarApi.new_sessionr   c                 Ã   r   )z¯Close an avatar session.

        Args:
            session_id: ID of the session to close

        Returns:
            Response data from the close session API call
        Nr   )r   r   r   r   r   Úclose_session9   r   zBaseAvatarApi.close_sessionN)
r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   *   s    r   N)
r   Úabcr   r   Útypingr   Úpydanticr   r   r   r   r   r   r   Ú<module>   s   