
    qi                    :   d Z ddlZddlmZmZ ddlmZmZmZm	Z	m
Z
mZmZmZmZmZmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddl m!Z! ddl"m#Z# ddl$m%Z%m&Z& er ddl'm(Z(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1  G d d      Z2 e2       Zdee3   fdZ4e G d d             Z5e G d de5             Z6e G d de5             Z7e G d de5             Z8e G d  d!             Z9e G d" d#             Z:e G d$ d%             Z;e G d& d'e7e:             Z<e G d( d)e7e;             Z=e G d* d+e<             Z>e G d, d-e<             Z?e G d. d/e=             Z@e G d0 d1e7             ZAe G d2 d3e7             ZBe G d4 d5eB             ZCe G d6 d7eB             ZDe G d8 d9eC             ZEe G d: d;eD             ZFe G d< d=eB             ZGe G d> d?eB             ZHe G d@ dAeB             ZIe G dB dCe7             ZJe G dD dEe7             ZKe G dF dG             ZLe G dH dI             ZMe G dJ dKe7             ZNe G dL dMe5             ZOe G dN dOe8             ZPe G dP dQe7             ZQe G dR dSe8             ZRe G dT dUe7             ZSe G dV dWe7             ZTe G dX dYe7             ZUe G dZ d[e7             ZVe G d\ d]e7             ZWe G d^ d_e7             ZXe G d` dae7             ZYe G db dce7             ZZe G dd de             Z[e G df dge7e9             Z\e G dh die7             Z]e G dj dke7             Z^e G dl dme^             Z_e G dn do             Z`e G dp dqe`e7             Zae G dr dse6             Zbe G dt due6             Zce G dv dwe6             Zde G dx dyed             Zee G dz d{e6             Zfe G d| d}e6             Zge G d~ de6             Zhe G d deh             Zie G d de6             Zje G d de6             Zke G d de6             Zle G d de6             Zme G d de6             Zne G d de6             Zoe G d de6             Zpe G d de6             Zqe G d de6             Zre G d de6             Zse G d de6             Zte G d de6             Zue G d de6             Zve G d d             Zwe G d de6             Zxe G d de6             Zye G d de6             Zze G d de6             Z{e G d de{             Z|e G d de6             Z}e G d de}             Z~e G d de6             Ze G d de6e:             Ze G d de6e;             Ze G d de6eB             Ze G d de             Ze G d de             Ze G d de=             Ze G d de`e6             Ze G d de`e6             Ze G d de6             Ze G d de6             Ze G d de             Ze G dĄ de8             Ze G dƄ de6             Ze G dȄ de             Ze G dʄ de             Ze G d̄ de             Ze G d΄ de             Ze G dЄ de             Ze G d҄ de8e9             Ze G dԄ de8e9             Ze G dք de6             Ze G d؄ de6             Ze G dڄ de8             Ze G d܄ de8             Ze G dބ de8             Ze G d de8             Ze G d de8             Ze G d de8             Ze G d de8             Ze G d de8             Ze G d de8             Ze G d de8e9             Ze G d de8e9             Ze G d de             Ze G d de             Ze G d de8             Ze G d de8             Ze G d de8e9             Ze G d de             Ze G d de             Ze G d de             Ze G d  de6             Ze G d de8             Ze G d de8             Ze G d de             Ze G d d	e             Ze G d
 de8             Ze G d de             Ze G d de             Ze G d de8             Ze G d de             Zy(  zCore frame definitions for the Pipecat AI framework.

This module contains all frame types used throughout the Pipecat pipeline system,
including data frames, system frames, and control frames for audio, video, text,
and LLM processing.
    N)	dataclassfield)TYPE_CHECKINGAny	AwaitableCallableDictListLiteralMappingOptionalSequenceTuple)ToolsSchema)KeypadEntry)BaseInterruptionStrategy)BaseTurnParams)	VADParams)MetricsData)Language)AggregationTypenanoseconds_to_str)	obj_countobj_id)
LLMContextNotGiven)FrameProcessor)ServiceSettings)LLMContextSummaryConfig)TracingContextc                   D    e Zd ZdZeZed        ZdededefdZ	d Z
d Zy	)
DeprecatedKeypadEntryaB  DTMF keypad entries for phone system integration.

    .. deprecated:: 0.0.82
        This class is deprecated and will be removed in a future version.
        Instead, use `audio.dtmf.types.KeypadEntry`.

    Parameters:
        ONE: Number key 1.
        TWO: Number key 2.
        THREE: Number key 3.
        FOUR: Number key 4.
        FIVE: Number key 5.
        SIX: Number key 6.
        SEVEN: Number key 7.
        EIGHT: Number key 8.
        NINE: Number key 9.
        ZERO: Number key 0.
        POUND: Pound/hash key (#).
        STAR: Star/asterisk key (*).
    c                     dd l }|j                         5  |j                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   alwaysz`pipecat.frames.frames.KeypadEntry` is deprecated and will be removed in a future version. Use `pipecat.audio.dtmf.types.KeypadEntry` instead.   
stacklevelwarningscatch_warningssimplefilterwarnDeprecationWarning)clsr*   s     G/opt/pipecat/venv/lib/python3.12/site-packages/pipecat/frames/frames.py_warnzDeprecatedKeypadEntry._warnI   sQ    $$& 	!!(+MMF"	  	 	 	   *AAargskwargsreturnc                 F    | j                           | j                  |i |S )z.Allow the instance to be called as a function.r1   _enum)selfr3   r4   s      r0   __call__zDeprecatedKeypadEntry.__call__V   s!    

tzz4*6**    c                 N    | j                          t        | j                  |      S )z/Retrieve an attribute from the underlying enum.)r1   getattrr8   r9   names     r0   __getattr__z!DeprecatedKeypadEntry.__getattr__[   s    

tzz4((r;   c                 @    | j                          | j                  |   S )z*Retrieve an item from the underlying enum.r7   r>   s     r0   __getitem__z!DeprecatedKeypadEntry.__getitem__`   s    

zz$r;   N)__name__
__module____qualname____doc__NewKeypadEntryr8   classmethodr1   r   r:   r@   rB    r;   r0   r#   r#   1   sD    * E
 
+c +S +S +
)
 r;   r#   ptsc                      | rt        |       S dS )zFormat presentation timestamp (PTS) in nanoseconds to a human-readable string.

    Converts a PTS value in nanoseconds to a string representation.

    Args:
        pts: Presentation timestamp in nanoseconds, or None if not set.
    Nr   )rJ   s    r0   
format_ptsrL   i   s     '*c"3t3r;   c                      e Zd ZU dZ ed      Zeed<    ed      Ze	ed<    ed      Z
ee   ed<    ed      Zee   ed<    ed      Zee	ef   ed<    ed      Zee	   ed	<    ed      Zee	   ed
<   d Zd Zy)Framea)  Base frame class for all frames in the Pipecat pipeline.

    All frames inherit from this base class and automatically receive
    unique identifiers, names, and metadata support.

    Parameters:
        id: Unique identifier for the frame instance.
        name: Human-readable name combining class name and instance count.
        pts: Presentation timestamp in nanoseconds.
        broadcast_sibling_id: ID of the paired frame when this frame was
            broadcast in both directions. Set automatically by
            ``broadcast_frame()`` and ``broadcast_frame_instance()``.
        metadata: Dictionary for arbitrary frame metadata.
        transport_source: Name of the transport source that created this frame.
        transport_destination: Name of the transport destination for this frame.
    Finitidr?   rJ   broadcast_sibling_idmetadatatransport_sourcetransport_destinationc                     t               | _        | j                  j                   dt	        |        | _        d | _        d | _        i | _        d | _	        d | _
        y )N#)r   rQ   	__class__rC   r   r?   rJ   rR   rS   rT   rU   r9   s    r0   __post_init__zFrame.__post_init__   sS    x NN334Aio5FG	"&37!(*/348"r;   c                     | j                   S N)r?   rY   s    r0   __str__zFrame.__str__   s    yyr;   N)rC   rD   rE   rF   r   rQ   int__annotations__r?   strrJ   r   rR   rS   r	   r   rT   rU   rZ   r]   rI   r;   r0   rN   rN   t   s    " B5!D#!E*C#**/U*;(3-;$%0Hd38n0&+&7hsm7+0e+<8C=<9r;   rN   c                       e Zd ZdZy)SystemFramezSystem frame class for immediate processing.

    A frame that takes higher priority than other frames. System frames are
    handled in order and are not affected by user interruptions.
    NrC   rD   rE   rF   rI   r;   r0   rb   rb           	r;   rb   c                       e Zd ZdZy)	DataFramezData frame class for processing data in order.

    A frame that is processed in order and usually contains data such as LLM
    context, text, audio or images. Data frames are cancelled by user
    interruptions.
    Nrc   rI   r;   r0   rf   rf           	r;   rf   c                       e Zd ZdZy)ControlFramea<  Control frame class for processing control information in order.

    A frame that, similar to data frames, is processed in order and usually
    contains control information such as update settings or to end the pipeline
    after everything is flushed. Control frames are cancelled by user
    interruptions.

    Nrc   rI   r;   r0   ri   ri           	r;   ri   c                       e Zd ZdZy)UninterruptibleFrameah  A marker for data or control frames that must not be interrupted.

    Frames with this mixin are still ordered normally, but unlike other frames,
    they are preserved during interruptions: they remain in internal queues and
    any task processing them will not be cancelled. This ensures the frame is
    always delivered and processed to completion.

    Nrc   rI   r;   r0   rl   rl      rj   r;   rl   c                   T    e Zd ZU dZeed<   eed<   eed<    edd      Zeed<   d	 Z	y
)AudioRawFramea  A frame containing a chunk of raw audio.

    Parameters:
        audio: Raw audio bytes in PCM format.
        sample_rate: Audio sample rate in Hz.
        num_channels: Number of audio channels.
        num_frames: Number of audio frames (calculated automatically).
    audiosample_ratenum_channelsr   FdefaultrP   
num_framesc                 j    t        t        | j                        | j                  dz  z        | _        y Nr&   )r^   lenro   rq   rt   rY   s    r0   rZ   zAudioRawFrame.__post_init__   s&    c$**o1B1BQ1FGHr;   N)
rC   rD   rE   rF   bytesr_   r^   r   rt   rZ   rI   r;   r0   rn   rn      s1     LAE2J2Ir;   rn   c                   @    e Zd ZU dZeed<   eeef   ed<   ee	   ed<   y)ImageRawFramezA frame containing a raw image.

    Parameters:
        image: Raw image bytes.
        size: Image dimensions as (width, height) tuple.
        format: Image format (e.g., 'RGB', 'RGBA').
    imagesizeformatN)
rC   rD   rE   rF   rx   r_   r   r^   r   r`   rI   r;   r0   rz   rz      s&     L
S/SMr;   rz   c                   (     e Zd ZdZ fdZd Z xZS )OutputAudioRawFramea  Audio data frame for output to transport.

    A chunk of raw audio that will be played by the output transport. If the
    transport supports multiple audio destinations (e.g. multiple audio tracks)
    the destination name can be specified in transport_destination.
    c                     t         |           t        t        | j                        | j
                  dz  z        | _        y rv   superrZ   r^   rw   ro   rq   rt   r9   rX   s    r0   rZ   z!OutputAudioRawFrame.__post_init__  2    c$**o1B1BQ1FGHr;   c                     t        | j                        }| j                   d| d| j                   dt	        | j
                         d| j                   d| j                   d| j                   dS )N(pts: , destination: , size: 
, frames: , sample_rate: , channels: ))	rL   rJ   r?   rU   rw   ro   rt   rp   rq   r9   rJ   s     r0   r]   zOutputAudioRawFrame.__str__	  s    "))F3%t7Q7Q6RRZ[^_c_i_i[jZkkuvz  wF  wF  vG  GV  W[  Wg  Wg  Vh  ht  uy  uF  uF  tG  GH  I  	Ir;   rC   rD   rE   rF   rZ   r]   __classcell__rX   s   @r0   r   r      s    IIr;   r   c                       e Zd ZdZd Zy)OutputImageRawFramezImage data frame for output to transport.

    An image that will be shown by the transport. If the transport supports
    multiple video destinations (e.g. multiple video tracks) the destination
    name can be specified in transport_destination.
    c           
          t        | j                        }| j                   d| d| j                   d| j                   d| j
                   d
S )Nr   r   r   
, format: r   )rL   rJ   r?   rU   r|   r}   r   s     r0   r]   zOutputImageRawFrame.__str__  sS    "))F3%t7Q7Q6RRZ[_[d[dZeeoptp{p{o||}~~r;   NrC   rD   rE   rF   r]   rI   r;   r0   r   r     s    r;   r   c                   &    e Zd ZU dZdZee   ed<   y)TTSAudioRawFramezAudio data frame generated by Text-to-Speech services.

    A chunk of output audio generated by a TTS service, ready for playback.

    Parameters:
        context_id: Unique identifier for the TTS context that generated this audio.
    N
context_idrC   rD   rE   rF   r   r   r`   r_   rI   r;   r0   r   r     s     !%J$r;   r   c                       e Zd ZdZy)SpeechOutputAudioRawFramea  An audio frame part of a speech audio stream.

    This frame is part of a continuous stream of audio frames containing speech.
    The audio stream might also contain silence frames, so a process to distinguish
    between speech and silence might be needed.
    Nrc   rI   r;   r0   r   r   )  rg   r;   r   c                   ,    e Zd ZU dZdZee   ed<   d Zy)URLImageRawFramea  Image frame with an associated URL.

    An output image with an associated URL. These images are usually
    generated by third-party services that provide a URL to download the image.

    Parameters:
        url: URL where the image can be downloaded from.
    Nurlc           
          t        | j                        }| j                   d| d| j                   d| j                   d| j
                   d
S )Nr   z, url: r   r   r   )rL   rJ   r?   r   r|   r}   r   s     r0   r]   zURLImageRawFrame.__str__B  sJ    "))F3%wtxxj:VZVaVaUbbcddr;   )	rC   rD   rE   rF   r   r   r`   r_   r]   rI   r;   r0   r   r   5  s     C#er;   r   c                   (    e Zd ZU dZee   ed<   d Zy)SpriteFramea_  Animated sprite frame containing multiple images.

    An animated sprite that will be shown by the transport if the transport's
    camera is enabled. Will play at the framerate specified in the transport's
    `camera_out_framerate` constructor parameter.

    Parameters:
        images: List of image frames that make up the sprite animation.
    imagesc                 |    t        | j                        }| j                   d| dt        | j                         dS )Nr   r   r   )rL   rJ   r?   rw   r   r   s     r0   r]   zSpriteFrame.__str__U  s7    "))F3%xDKK0@/ACCr;   N)rC   rD   rE   rF   r
   r   r_   r]   rI   r;   r0   r   r   G  s     $%%Dr;   r   c                        e Zd ZU dZeed<    ed      Zee	   ed<    ed      Z
e	ed<    ed      Ze	ed<    fdZd	 Z xZS )
	TextFrameaS  Text data frame for passing text through the pipeline.

    A chunk of text. Emitted by LLM services, consumed by context
    aggregators, TTS services and more. Can be used to send text
    through processors.

    Parameters:
        text: The text content.
        skip_tts: Whether this text should be skipped by the TTS service.
        includes_inter_frame_spaces: Whether any necessary inter-frame (leading/trailing) spaces are already
            included in the text.
        append_to_context: Whether this text should be appended to the LLM context.
            Defaults to True.
    textFrO   skip_ttsincludes_inter_frame_spacesappend_to_contextc                 L    t         |           d | _        d| _        d| _        y )NFT)r   rZ   r   r   r   r   s    r0   rZ   zTextFrame.__post_init__w  s%    +0(!%r;   c                 j    t        | j                        }| j                   d| d| j                   dS )Nr   	, text: [])rL   rJ   r?   r   r   s     r0   r]   zTextFrame.__str__}  s1    "))F3%y2>>r;   )rC   rD   rE   rF   r`   r_   r   r   r   boolr   r   rZ   r]   r   r   s   @r0   r   r   Z  sN     I$%0Hhtn0 ).5(99#/t/&?r;   r   c                   "     e Zd ZdZ fdZ xZS )LLMTextFramez%Text frame generated by LLM services.c                 0    t         |           d| _        y NTr   rZ   r   r   s    r0   rZ   zLLMTextFrame.__post_init__      +/(r;   rC   rD   rE   rF   rZ   r   r   s   @r0   r   r     s    /0 0r;   r   c                   6    e Zd ZU dZeez  ed<   dZee   ed<   y)AggregatedTextFrameav  Text frame representing an aggregation of TextFrames.

    This frame contains multiple TextFrames aggregated together for processing
    or output along with a field to indicate how they are aggregated.

    Parameters:
        aggregated_by: Method used to aggregate the text frames.
        context_id: Unique identifier for the TTS context that generated this text.
    aggregated_byNr   )	rC   rD   rE   rF   r   r`   r_   r   r   rI   r;   r0   r   r     s"     #S(( $J$r;   r   c                       e Zd ZdZy)VisionTextFramez(Text frame generated by vision services.Nrc   rI   r;   r0   r   r         2r;   r   c                   &    e Zd ZU dZdZee   ed<   y)TTSTextFramezText frame generated by Text-to-Speech services.

    Parameters:
        context_id: Unique identifier for the TTS context that generated this text.
    Nr   r   rI   r;   r0   r   r          !%J$r;   r   c                   b    e Zd ZU dZeed<   eed<   dZee   ed<   dZ	ee
   ed<   dZeed<   d	 Zy)
TranscriptionFramea4  Text frame containing speech transcription data.

    A text frame with transcription-specific data. The `result` field
    contains the result from the STT service if available.

    Parameters:
        user_id: Identifier for the user who spoke.
        timestamp: When the transcription occurred.
        language: Detected or specified language of the speech.
        result: Raw result from the STT service.
        finalized: Whether this is the final transcription for an utterance.
            Set by STT services that support commit/finalize signals.
    user_id	timestampNlanguageresultF	finalizedc           
          | j                    d| j                   d| j                   d| j                   d| j                   d
S N(user: r   z], language: z, timestamp: r   r?   r   r   r   r   rY   s    r0   r]   zTranscriptionFrame.__str__  K    ))GDLL>499+]SWS`S`Raanoso}o}n~~  A  	Ar;   )rC   rD   rE   rF   r`   r_   r   r   r   r   r   r   r   r]   rI   r;   r0   r   r     s@     LN#'Hhx ' FHSM ItAr;   r   c                   ^    e Zd ZU dZeed<   eed<   eed<   dZee   ed<   dZ	ee
   ed<   d Zy)	InterimTranscriptionFramea  Text frame containing partial/interim transcription data.

    A text frame with interim transcription-specific data that represents
    partial results before final transcription. The `result` field
    contains the result from the STT service if available.

    Parameters:
        user_id: Identifier for the user who spoke.
        timestamp: When the interim transcription occurred.
        language: Detected or specified language of the speech.
        result: Raw result from the STT service.
    r   r   r   Nr   r   c           
          | j                    d| j                   d| j                   d| j                   d| j                   d
S r   r   rY   s    r0   r]   z!InterimTranscriptionFrame.__str__  r   r;   )rC   rD   rE   rF   r`   r_   r   r   r   r   r   r]   rI   r;   r0   r   r     s;     ILN#'Hhx ' FHSM Ar;   r   c                   @    e Zd ZU dZeed<   eed<   dZee   ed<   d Z	y)TranslationFrameao  Text frame containing translated transcription data.

    A text frame with translated transcription data that will be placed
    in the transport's receive queue when a participant speaks.

    Parameters:
        user_id: Identifier for the user who spoke.
        timestamp: When the translation occurred.
        language: Target language of the translation.
    r   r   Nr   c           
          | j                    d| j                   d| j                   d| j                   d| j                   d
S r   r   rY   s    r0   r]   zTranslationFrame.__str__  r   r;   )
rC   rD   rE   rF   r`   r_   r   r   r   r]   rI   r;   r0   r   r     s(    	 LN#'Hhx 'Ar;   r   c                   .     e Zd ZU dZeed<    fdZ xZS )'OpenAILLMContextAssistantTimestampFramea  Timestamp information for assistant messages in LLM context.

    .. deprecated:: 0.0.99
        `OpenAILLMContextAssistantTimestampFrame` is deprecated and will be removed in a future version.
        Use `LLMContextAssistantTimestampFrame` with the universal `LLMContext` and `LLMContextAggregatorPair` instead.
        See `OpenAILLMContext` docstring for migration guide.

    Parameters:
        timestamp: Timestamp when the assistant message was created.
    r   c                     t         |           dd l}|j                         5  |j	                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zOpenAILLMContextAssistantTimestampFrame is deprecated and will be removed in a future version. Use LLMContextAssistantTimestampFrame with the universal LLMContext and LLMContextAggregatorPair instead. See OpenAILLMContext docstring for migration guide.r&   r'   r   rZ   r*   r+   r,   r-   r.   r9   r*   rX   s     r0   rZ   z5OpenAILLMContextAssistantTimestampFrame.__post_init__  s_    $$& 	!!(+MMF #  	 	 	   *AA )rC   rD   rE   rF   r`   r_   rZ   r   r   s   @r0   r   r     s    	 N r;   r   c                       e Zd ZU dZeed<   y)!LLMContextAssistantTimestampFramezTimestamp information for assistant messages in LLM context.

    Parameters:
        timestamp: Timestamp when the assistant message was created.
    r   NrC   rD   rE   rF   r`   r_   rI   r;   r0   r   r     s     Nr;   r   c                   Z    e Zd ZU dZed   ed<   eed<   dZee   ed<   dZ	ee   ed<   d Z
y)	TranscriptionMessagea  A message in a conversation transcript.

    A message in a conversation transcript containing the role and content.
    Messages are in standard format with roles normalized to user/assistant.

    Parameters:
        role: The role of the message sender (user or assistant).
        content: The message content/text.
        user_id: Optional identifier for the user.
        timestamp: Optional timestamp when the message was created.

    .. deprecated:: 0.0.99
        `TranscriptionMessage` is deprecated and will be removed in a future version.
        Use `LLMUserAggregator`'s and `LLMAssistantAggregator`'s new events instead.
    )user	assistantrolecontentNr   r   c                     dd l }|j                         5  |j                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zTranscriptionMessage is deprecated and will be removed in a future version. Use `LLMUserAggregator`'s and `LLMAssistantAggregator`'s new events instead.r&   r'   r)   r9   r*   s     r0   rZ   z"TranscriptionMessage.__post_init__6  sQ    $$& 	!!(+MM_"	  	 	 	r2   )rC   rD   rE   rF   r   r_   r`   r   r   r   rZ   rI   r;   r0   r   r     s;      %
&&L!GXc]!#Ix}#
r;   r   c                   Z    e Zd ZU dZ edd      Zed   ed<   eed<   dZ	e
e   ed<   d	 Zy)
ThoughtTranscriptionMessagezAn LLM thought message in a conversation transcript.

    .. deprecated:: 0.0.99
        `ThoughtTranscriptionMessage` is deprecated and will be removed in a future version.
        Use `LLMAssistantAggregator`'s new events instead.
    r   Frr   r   r   Nr   c                     dd l }|j                         5  |j                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zThoughtTranscriptionMessage is deprecated and will be removed in a future version. Use `LLMAssistantAggregator`'s new events instead.r&   r'   r)   r   s     r0   rZ   z)ThoughtTranscriptionMessage.__post_init__P  sQ    $$& 	!!(+MME"	  	 	 	r2   )rC   rD   rE   rF   r   r   r   r_   r`   r   r   rZ   rI   r;   r0   r   r   C  s7     "'{!GD'+
GL#Ix}#
r;   r   c                   @     e Zd ZU dZeeez     ed<    fdZd Z	 xZ
S )TranscriptionUpdateFramea  Frame containing new messages added to conversation transcript.

    A frame containing new messages added to the conversation transcript.
    This frame is emitted when new messages are added to the conversation history,
    containing only the newly added messages rather than the full transcript.
    Messages have normalized roles (user/assistant) regardless of the LLM service used.
    Messages are always in the OpenAI standard message format, which supports both:

    Examples:
        Simple format::

            [
                {
                    "role": "user",
                    "content": "Hi, how are you?"
                },
                {
                    "role": "assistant",
                    "content": "Great! And you?"
                }
            ]

        Content list format::

            [
                {
                    "role": "user",
                    "content": [{"type": "text", "text": "Hi, how are you?"}]
                },
                {
                    "role": "assistant",
                    "content": [{"type": "text", "text": "Great! And you?"}]
                }
            ]

    OpenAI supports both formats. Anthropic and Google messages are converted to the
    content list format.

    Parameters:
        messages: List of new transcript messages that were added.

    .. deprecated:: 0.0.99
        `TranscriptionUpdateFrame` is deprecated and will be removed in a future version.
        Use `LLMUserAggregator`'s and `LLMAssistantAggregator`'s new events instead.
    messagesc                     t         |           dd l}|j                         5  |j	                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zTranscriptionUpdateFrame is deprecated and will be removed in a future version. Use `LLMUserAggregator`'s and `LLMAssistantAggregator`'s new events instead.r&   r'   r   r   s     r0   rZ   z&TranscriptionUpdateFrame.__post_init__  s]    $$& 	!!(+MM_"	  	 	 	r   c                 |    t        | j                        }| j                   d| dt        | j                         dS )Nr   z, messages: r   )rL   rJ   r?   rw   r   r   s     r0   r]   z TranscriptionUpdateFrame.__str__  s7    "))F3%|C4F3GqIIr;   )rC   rD   rE   rF   r
   r   r   r_   rZ   r]   r   r   s   @r0   r   r   ]  s(    ,\ '*EEFFJr;   r   c                       e Zd ZU dZded<   y)LLMContextFramezFrame containing a universal LLM context.

    Used as a signal to LLM services to ingest the provided context and
    generate a response based on it.

    Parameters:
        context: The LLM context containing messages, tools, and configuration.
    r   contextNrC   rD   rE   rF   r_   rI   r;   r0   r   r     s     r;   r   c                   L     e Zd ZU dZdZeed<   dZee	   ed<    fdZ
d Z xZS )LLMThoughtStartFramea  Frame indicating the start of an LLM thought.

    Parameters:
        append_to_context: Whether the thought should be appended to the LLM context.
            If it is appended, the `llm` field is required, since it will be
            appended as an `LLMSpecificMessage`.
        llm: Optional identifier of the LLM provider for LLM-specific handling.
            Only required if `append_to_context` is True, as the thought is
            appended to context as an `LLMSpecificMessage`.
    Fr   Nllmc                 j    t         |           | j                  r| j                  t	        d      y y )Nz/When append_to_context is True, llm must be set)r   rZ   r   r   
ValueErrorr   s    r0   rZ   z"LLMThoughtStartFrame.__post_init__  s4    !!dhh&6NOO '7!r;   c                     t        | j                        }| j                   d| d| j                   d| j                   dS )Nr   , append_to_context: z, llm: r   )rL   rJ   r?   r   r   r   s     r0   r]   zLLMThoughtStartFrame.__str__  sG    "yyku$9$:P:P9QQXY]YaYaXbbcd	
r;   )rC   rD   rE   rF   r   r   r_   r   r   r`   rZ   r]   r   r   s   @r0   r   r     s.    	 $t#C#P

r;   r   c                   P     e Zd ZU dZeed<    ed      Zeed<    fdZ	d Z
 xZS )LLMThoughtTextFramea  Frame containing the text (or text chunk) of an LLM thought.

    Note that despite this containing text, it is a DataFrame and not a
    TextFrame, to avoid most typical text processing, such as TTS.

    Parameters:
        text: The text (or text chunk) of the thought.
    r   FrO   r   c                 0    t         |           d| _        y r   r   r   s    r0   rZ   z!LLMThoughtTextFrame.__post_init__  r   r;   c                 j    t        | j                        }| j                   d| d| j                   dS )Nr   z, thought text: r   r   r   s     r0   r]   zLLMThoughtTextFrame.__str__  s2    "))F3%'7		{!DDr;   )rC   rD   rE   rF   r`   r_   r   r   r   rZ   r]   r   r   s   @r0   r   r     s*     I(-5(990
Er;   r   c                   &    e Zd ZU dZdZeed<   d Zy)LLMThoughtEndFramezFrame indicating the end of an LLM thought.

    Parameters:
        signature: Optional signature associated with the thought.
            This is used by Anthropic, which includes a signature at the end of
            each thought.
    N	signaturec                 j    t        | j                        }| j                   d| d| j                   dS )Nr   z, signature: r   )rL   rJ   r?   r   r   s     r0   r]   zLLMThoughtEndFrame.__str__  s2    "))F3%}T^^4DAFFr;   )rC   rD   rE   rF   r   r   r_   r]   rI   r;   r0   r   r     s     IsGr;   r   c                   4     e Zd ZU dZee   ed<    fdZ xZS )LLMMessagesFramea  Frame containing LLM messages for chat completion.

    .. deprecated:: 0.0.79
        This class is deprecated and will be removed in a future version.
        Instead, use either:
        - `LLMMessagesUpdateFrame` with `run_llm=True`
        - `OpenAILLMContextFrame` with desired messages in a new context

    A frame containing a list of LLM messages. Used to signal that an LLM
    service should run a chat completion and emit an LLMFullResponseStartFrame,
    TextFrames and an LLMFullResponseEndFrame. Note that the `messages`
    property in this class is mutable, and will be updated by various
    aggregators.

    Parameters:
        messages: List of message dictionaries in LLM format.
    r   c                     t         |           dd l}|j                         5  |j	                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zLLMMessagesFrame is deprecated and will be removed in a future version. Instead, use either `LLMMessagesUpdateFrame` with `run_llm=True`, or `OpenAILLMContextFrame` with desired messages in a new contextr&   r'   r   r   s     r0   rZ   zLLMMessagesFrame.__post_init__  s_    $$& 		!!(+MMQ #  		 		 		r   )	rC   rD   rE   rF   r
   dictr_   rZ   r   r   s   @r0   r   r     s    $ 4j r;   r   c                       e Zd ZdZy)LLMRunFramezFrame to trigger LLM processing with current context.

    A frame that instructs the LLM service to process the current context and
    generate a response.
    Nrc   rI   r;   r0   r  r    rd   r;   r  c                   6    e Zd ZU dZee   ed<   dZee	   ed<   y)LLMMessagesAppendFramea3  Frame containing LLM messages to append to current context.

    A frame containing a list of LLM messages that need to be added to the
    current context.

    Parameters:
        messages: List of message dictionaries to append.
        run_llm: Whether the context update should be sent to the LLM.
    r   Nrun_llm
rC   rD   rE   rF   r
   r  r_   r  r   r   rI   r;   r0   r  r  &  !     4j"GXd^"r;   r  c                   6    e Zd ZU dZee   ed<   dZee	   ed<   y)LLMMessagesUpdateFrameaE  Frame containing LLM messages to replace current context.

    A frame containing a list of new LLM messages to replace the current
    context LLM messages.

    Parameters:
        messages: List of message dictionaries to replace current context.
        run_llm: Whether the context update should be sent to the LLM.
    r   Nr  r  rI   r;   r0   r
  r
  6  r  r;   r
  c                   .    e Zd ZU dZee   ez  dz  ed<   y)LLMSetToolsFrameaD  Frame containing tools for LLM function calling.

    A frame containing a list of tools for an LLM to use for function calling.
    The specific format depends on the LLM being used, but it should typically
    contain JSON Schema objects.

    Parameters:
        tools: List of tool/function definitions for the LLM.
    r   toolsN)rC   rD   rE   rF   r
   r  r   r_   rI   r;   r0   r  r  F  s     :#j00r;   r  c                   (    e Zd ZU dZed   ez  ed<   y)LLMSetToolChoiceFramezFrame containing tool choice configuration for LLM function calling.

    Parameters:
        tool_choice: Tool choice setting - 'none', 'auto', 'required', or specific tool dict.
    )noneautorequiredtool_choiceN)rC   rD   rE   rF   r   r  r_   rI   r;   r0   r  r  U  s     34t;;r;   r  c                       e Zd ZU dZeed<   y)LLMEnablePromptCachingFramezwFrame to enable/disable prompt caching in LLMs.

    Parameters:
        enable: Whether to enable prompt caching.
    enableNrC   rD   rE   rF   r   r_   rI   r;   r0   r  r  `       Lr;   r  c                       e Zd ZU dZeed<   y)LLMConfigureOutputFrameah  Frame to configure LLM output.

    This frame is used to configure how the LLM produces output. For example, it
    can tell the LLM to generate tokens that should be added to the context but
    not spoken by the TTS service (if one is present in the pipeline).

    Parameters:
        skip_tts: Whether LLM tokens should skip the TTS service (if any).
    r   Nr  rI   r;   r0   r  r  k  s     Nr;   r  c                   J    e Zd ZU dZdZee   ed<   dZee	g e
d   f      ed<   y)FunctionCallResultPropertieszProperties for configuring function call result behavior.

    Parameters:
        run_llm: Whether to run the LLM after receiving this result.
        on_context_updated: Callback to execute when context is updated.
    Nr  on_context_updated)rC   rD   rE   rF   r  r   r   r_   r  r   r   rI   r;   r0   r  r  z  s5     #GXd^"BF"io*=!>?Fr;   r  c                   b    e Zd ZU dZeed<   eed<   eed<   eed<   dZee	   ed<   dZ
ee   ed<   y)	FunctionCallResultFramea*  Frame containing the result of an LLM function call.

    This is an uninterruptible frame because once a result is generated we
    always want to update the context.

    Parameters:
        function_name: Name of the function that was executed.
        tool_call_id: Unique identifier for the function call.
        arguments: Arguments that were passed to the function.
        result: The result returned by the function.
        run_llm: Whether to run the LLM after this result.
        properties: Additional properties for result handling.

    function_nametool_call_id	argumentsr   Nr  
properties)rC   rD   rE   rF   r`   r_   r   r  r   r   r#  r  rI   r;   r0   r  r    s=     NK"GXd^"9=J56=r;   r  c                   0    e Zd ZU dZeed<   dZee   ed<   y)TTSSpeakFramea  Frame containing text that should be spoken by TTS.

    A frame that contains text that should be spoken by the TTS service
    in the pipeline (if any).

    Parameters:
        text: The text to be spoken.
        append_to_context: Whether to append the text to the context.
    r   Nr   )	rC   rD   rE   rF   r`   r_   r   r   r   rI   r;   r0   r%  r%    s     I(,x~,r;   r%  c                   "    e Zd ZU dZeed<   d Zy)OutputTransportMessageFramezwFrame containing transport-specific message data.

    Parameters:
        message: The transport message payload.
    messagec                 :    | j                    d| j                   dS Nz
(message: r   r?   r(  rY   s    r0   r]   z#OutputTransportMessageFrame.__str__      ))Jt||nA66r;   NrC   rD   rE   rF   r   r_   r]   rI   r;   r0   r'  r'         L7r;   r'  c                   "     e Zd ZdZ fdZ xZS )TransportMessageFramea  Frame containing transport-specific message data.

    .. deprecated:: 0.0.87
        This frame is deprecated and will be removed in a future version.
        Instead, use `OutputTransportMessageFrame`.

    Parameters:
        message: The transport message payload.
    c                     t         |           dd l}|j                         5  |j	                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zvTransportMessageFrame is deprecated and will be removed in a future version. Instead, use OutputTransportMessageFrame.r&   r'   r   r   s     r0   rZ   z#TransportMessageFrame.__post_init__  \    $$& 	!!(+MM<"	  	 	 	r   r   r   s   @r0   r0  r0         r;   r0  c                       e Zd ZU dZeed<   y)	DTMFFramezBase class for DTMF (Dual-Tone Multi-Frequency) keypad frames.

    Parameters:
        button: The DTMF keypad entry that was pressed.
    buttonN)rC   rD   rE   rF   rG   r_   rI   r;   r0   r5  r5    s     r;   r5  c                       e Zd ZdZy)OutputDTMFFramea  DTMF keypress output frame for transport queuing.

    A DTMF keypress output that will be queued. If your transport supports
    multiple dial-out destinations, use the `transport_destination` field to
    specify where the DTMF keypress should be sent.
    Nrc   rI   r;   r0   r8  r8    rg   r;   r8  c                       e Zd ZU dZdZeed<   dZeed<   dZe	ed<   dZ
e	ed<   dZe	ed	<   dZe	ed
<    ee      Zee   ed<   dZe	ed<   dZed   ed<   y)
StartFrameaF  Initial frame to start pipeline processing.

    This is the first frame that should be pushed down a pipeline to
    initialize all processors with their configuration parameters.

    Parameters:
        audio_in_sample_rate: Input audio sample rate in Hz.
        audio_out_sample_rate: Output audio sample rate in Hz.
        allow_interruptions: Whether to allow user interruptions.

            .. deprecated:: 0.0.99
                Use  `LLMUserAggregator`'s new `user_mute_strategies` parameter instead.

        enable_metrics: Whether to enable performance metrics collection.
        enable_tracing: Whether to enable OpenTelemetry tracing.
        enable_usage_metrics: Whether to enable usage metrics collection.
        interruption_strategies: List of interruption handling strategies.

            .. deprecated:: 0.0.99
                Use  `LLMUserAggregator`'s new `user_turn_strategies` parameter instead.

        report_only_initial_ttfb: Whether to report only initial time-to-first-byte.
        tracing_context: Pipeline-scoped tracing context for span hierarchy.
    i>  audio_in_sample_ratei]  audio_out_sample_rateFallow_interruptionsenable_metricsenable_tracingenable_usage_metricsdefault_factoryinterruption_strategiesreport_only_initial_ttfbNr!   tracing_context)rC   rD   rE   rF   r;  r^   r_   r<  r=  r   r>  r?  r@  r   listrC  r
   r   rD  rE  r   rI   r;   r0   r:  r:    s{    2 !&#%!&3& %% ND  ND !&$&>CTX>YT":;Y%*d*26OX./6r;   r:  c                   ,    e Zd ZU dZdZee   ed<   d Zy)CancelFramezFrame indicating pipeline should stop immediately.

    Indicates that a pipeline needs to stop right away without
    processing remaining queued frames.

    Parameters:
        reason: Optional reason for pushing a cancel frame.
    Nreasonc                 :    | j                    d| j                   dS Nz	(reason: r   r?   rI  rY   s    r0   r]   zCancelFrame.__str__'      ))Idkk]!44r;   	rC   rD   rE   rF   rI  r   r   r_   r]   rI   r;   r0   rH  rH    s     !FHSM 5r;   rH  c                   X    e Zd ZU dZeed<   dZeed<   dZe	d   ed<   dZ
e	e   ed<   d	 Zy)

ErrorFramea  Frame notifying of errors in the pipeline.

    This is used to notify upstream that an error has occurred downstream in
    the pipeline. A fatal error indicates the error is unrecoverable and that the
    bot should exit.

    Parameters:
        error: Description of the error that occurred.
        fatal: Whether the error is fatal and requires bot shutdown.
        processor: The frame processor that generated the error.
        exception: The exception that occurred.
    errorFfatalNr   	processor	exceptionc                 T    | j                    d| j                   d| j                   dS )Nz(error: z	, fatal: r   )r?   rQ  rR  rY   s    r0   r]   zErrorFrame.__str__?  s'    ))HTZZL	$**QGGr;   )rC   rD   rE   rF   r`   r_   rR  r   rS  r   rT  	Exceptionr]   rI   r;   r0   rP  rP  +  s=     JE4,0Ix()0%)Ix	")Hr;   rP  c                   0    e Zd ZU dZ edd      Zeed<   y)FatalErrorFramezFrame notifying of unrecoverable errors requiring bot shutdown.

    This is used to notify upstream that an unrecoverable error has occurred and
    that the bot should exit immediately.

    Parameters:
        fatal: Always True for fatal errors.
    TFrr   rR  N)rC   rD   rE   rF   r   rR  r   r_   rI   r;   r0   rX  rX  C  s     51E41r;   rX  c                       e Zd ZU dZded<   y)FrameProcessorPauseUrgentFramea~  Frame to pause frame processing immediately.

    This frame is used to pause frame processing for the given processor as
    fast as possible. Pausing frame processing will keep frames in the internal
    queue which will then be processed when frame processing is resumed with
    `FrameProcessorResumeFrame`.

    Parameters:
        processor: The frame processor to pause.
    r   rS  Nr   rI   r;   r0   rZ  rZ  Q      	  r;   rZ  c                       e Zd ZU dZded<   y)FrameProcessorResumeUrgentFrameaT  Frame to resume frame processing immediately.

    This frame is used to resume frame processing for the given processor
    if it was previously paused as fast as possible. After resuming frame
    processing all queued frames will be processed in the order received.

    Parameters:
        processor: The frame processor to resume.
    r   rS  Nr   rI   r;   r0   r]  r]  a        r;   r]  c                       e Zd ZdZy)InterruptionFramezFrame pushed to interrupt the pipeline.

    This frame is used to interrupt the pipeline. For example, when a user
    starts speaking to cancel any in-progress bot output. It can also be pushed
    by any processor.
    Nrc   rI   r;   r0   r`  r`  p  rg   r;   r`  c                   "     e Zd ZdZ fdZ xZS )StartInterruptionFramea  Frame indicating user started speaking (interruption detected).

    .. deprecated:: 0.0.85
        This frame is deprecated and will be removed in a future version.
        Instead, use `InterruptionFrame`.

    Emitted by the BaseInputTransport to indicate that a user has started
    speaking (i.e. is interrupting). This is similar to
    UserStartedSpeakingFrame except that it should be pushed concurrently
    with other frames (so the order is not guaranteed).
    c                     t         |           dd l}|j                         5  |j	                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zmStartInterruptionFrame is deprecated and will be removed in a future version. Instead, use InterruptionFrame.r&   r'   r   r   s     r0   rZ   z$StartInterruptionFrame.__post_init__  s\    $$& 	!!(+MM2"	  	 	 	r   r   r   s   @r0   rb  rb  |      
 r;   rb  c                        e Zd ZU dZdZeed<   y)UserStartedSpeakingFramea|  Frame indicating that the user turn has started.

    Emitted when the user turn starts, which usually means that some
    transcriptions are already available.

    Parameters:
        emulated: Whether this event was emulated rather than detected by VAD.

            .. deprecated:: 0.0.99
                This field is deprecated and will be removed in a future version.

    FemulatedNrC   rD   rE   rF   rg  r   r_   rI   r;   r0   rf  rf         Hdr;   rf  c                        e Zd ZU dZdZeed<   y)UserStoppedSpeakingFrameak  Frame indicating that the user turn has ended.

    Emitted when the user turn ends. This usually coincides with the start of
    the bot turn.

    Parameters:
        emulated: Whether this event was emulated rather than detected by VAD.

            .. deprecated:: 0.0.99
                This field is deprecated and will be removed in a future version.

    Frg  Nrh  rI   r;   r0   rk  rk    ri  r;   rk  c                       e Zd ZdZy)UserMuteStartedFramezFrame indicating that the user has been muted.

    Emitted when a mute strategy activates, suppressing user frames (audio,
    transcription, interruption) from propagating through the pipeline.
    Nrc   rI   r;   r0   rm  rm    rd   r;   rm  c                       e Zd ZdZy)UserMuteStoppedFramezFrame indicating that the user has been unmuted.

    Emitted when a mute strategy deactivates, allowing user frames to
    propagate through the pipeline again.
    Nrc   rI   r;   r0   ro  ro    rd   r;   ro  c                       e Zd ZdZy)UserSpeakingFramezaFrame indicating the user is speaking.

    Emitted by VAD to indicate the user is speaking.
    Nrc   rI   r;   r0   rq  rq        
 	r;   rq  c                   "     e Zd ZdZ fdZ xZS )EmulateUserStartedSpeakingFramea  Frame to emulate user started speaking behavior.

    Emitted by internal processors upstream to emulate VAD behavior when a
    user starts speaking.

    .. deprecated:: 0.0.99
        This frame is deprecated and will be removed in a future version.
    c                     t         |           dd l}|j                         5  |j	                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zVEmulateUserStartedSpeakingFrame is deprecated and will be removed in a future version.r&   r'   r   r   s     r0   rZ   z-EmulateUserStartedSpeakingFrame.__post_init__  Z    $$& 	!!(+MMh"  	 	 	r   r   r   s   @r0   rt  rt         r;   rt  c                   "     e Zd ZdZ fdZ xZS )EmulateUserStoppedSpeakingFramea   Frame to emulate user stopped speaking behavior.

    Emitted by internal processors upstream to emulate VAD behavior when a
    user stops speaking.

    .. deprecated:: 0.0.99
        This frame is deprecated and will be removed in a future version.
    c                     t         |           dd l}|j                         5  |j	                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zVEmulateUserStoppedSpeakingFrame is deprecated and will be removed in a future version.r&   r'   r   r   s     r0   rZ   z-EmulateUserStoppedSpeakingFrame.__post_init__   rv  r   r   r   s   @r0   ry  ry    rw  r;   ry  c                   P    e Zd ZU dZdZeed<    eej                        Z	eed<   y)VADUserStartedSpeakingFramea{  Frame emitted when VAD definitively detects user started speaking.

    Parameters:
        start_secs: The VAD start_secs duration that was used to confirm the user
            started speaking. This represents the speech duration that had to
            elapse before the VAD determined speech began.
        timestamp: Wall-clock time when the VAD made its determination.
            
start_secsrA  r   N)
rC   rD   rE   rF   r~  floatr_   r   timer   rI   r;   r0   r|  r|    s&     JTYY7Iu7r;   r|  c                   P    e Zd ZU dZdZeed<    eej                        Z	eed<   y)VADUserStoppedSpeakingFrameaz  Frame emitted when VAD definitively detects user stopped speaking.

    Parameters:
        stop_secs: The VAD stop_secs duration that was used to confirm the user
            stopped speaking. This represents the silence duration that had to
            elapse before the VAD determined speech ended.
        timestamp: Wall-clock time when the VAD made its determination.
    r}  	stop_secsrA  r   N)
rC   rD   rE   rF   r  r  r_   r   r  r   rI   r;   r0   r  r    s&     IuTYY7Iu7r;   r  c                       e Zd ZdZy)BotStartedSpeakingFramezFrame indicating the bot started speaking.

    Emitted upstream and downstream by the BaseTransportOutput to indicate the
    bot started speaking.
    Nrc   rI   r;   r0   r  r  ,  rd   r;   r  c                       e Zd ZdZy)BotStoppedSpeakingFramezFrame indicating the bot stopped speaking.

    Emitted upstream and downstream by the BaseTransportOutput to indicate the
    bot stopped speaking.
    Nrc   rI   r;   r0   r  r  7  rd   r;   r  c                       e Zd ZdZy)BotSpeakingFrameaT  Frame indicating the bot is currently speaking.

    Emitted upstream and downstream by the BaseOutputTransport while the bot is
    still speaking. This can be used, for example, to detect when a user is
    idle. That is, while the bot is speaking we don't want to trigger any user
    idle timeout since the user might be listening.
    Nrc   rI   r;   r0   r  r  B       	r;   r  c                   "    e Zd ZU dZee   ed<   y)MetricsFramezFrame containing performance metrics data.

    Emitted by processors that can compute metrics like latencies.

    Parameters:
        data: List of metrics data collected by the processor.
    dataN)rC   rD   rE   rF   r
   r   r_   rI   r;   r0   r  r  O  s     {
r;   r  c                   D    e Zd ZU dZeed<   eed<   eeef   ed<   eed<   y)FunctionCallFromLLMa  Represents a function call returned by the LLM.

    Represents a function call returned by the LLM to be registered for execution.

    Parameters:
        function_name: The name of the function to call.
        tool_call_id: A unique identifier for the function call.
        arguments: The arguments to pass to the function.
        context: The LLM context when the function call was made.
    r   r!  r"  r   N)rC   rD   rE   rF   r`   r_   r   r   rI   r;   r0   r  r  \  s)    	 sCx  Lr;   r  c                   "    e Zd ZU dZee   ed<   y)FunctionCallsStartedFramezFrame signaling that function call execution is starting.

    A frame signaling that one or more function call execution is going to
    start.

    Parameters:
        function_calls: Sequence of function calls that will be executed.
    function_callsN)rC   rD   rE   rF   r   r  r_   rI   r;   r0   r  r  o  s     011r;   r  c                   &    e Zd ZU dZeed<   eed<   y)FunctionCallCancelFramezFrame signaling that a function call has been cancelled.

    Parameters:
        function_name: Name of the function that was cancelled.
        tool_call_id: Unique identifier for the cancelled function call.
    r   r!  Nr   rI   r;   r0   r  r  }  s     r;   r  c                       e Zd ZU dZeed<   y)STTMuteFramezFrame to mute/unmute the Speech-to-Text service.

    Parameters:
        mute: Whether to mute (True) or unmute (False) the STT service.
    muteNr  rI   r;   r0   r  r    s     Jr;   r  c                   "    e Zd ZU dZeed<   d Zy)InputTransportMessageFramezFrame for transport messages received from external sources.

    Parameters:
        message: The urgent transport message payload.
    r(  c                 :    | j                    d| j                   dS r*  r+  rY   s    r0   r]   z"InputTransportMessageFrame.__str__  r,  r;   Nr-  rI   r;   r0   r  r    r.  r;   r  c                   "     e Zd ZdZ fdZ xZS ) InputTransportMessageUrgentFramea"  Frame for transport messages received from external sources.

    .. deprecated:: 0.0.87
        This frame is deprecated and will be removed in a future version.
        Instead, use `InputTransportMessageFrame`.

    Parameters:
        message: The urgent transport message payload.
    c                     t         |           dd l}|j                         5  |j	                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zInputTransportMessageUrgentFrame is deprecated and will be removed in a future version. Instead, use InputTransportMessageFrame.r&   r'   r   r   s     r0   rZ   z.InputTransportMessageUrgentFrame.__post_init__  s\    $$& 	!!(+MM;"	  	 	 	r   r   r   s   @r0   r  r    r3  r;   r  c                   "    e Zd ZU dZeed<   d Zy)!OutputTransportMessageUrgentFramezFrame for urgent transport messages that need to be sent immediately.

    Parameters:
        message: The urgent transport message payload.
    r(  c                 :    | j                    d| j                   dS r*  r+  rY   s    r0   r]   z)OutputTransportMessageUrgentFrame.__str__  r,  r;   Nr-  rI   r;   r0   r  r    r.  r;   r  c                   "     e Zd ZdZ fdZ xZS )TransportMessageUrgentFramea2  Frame for urgent transport messages that need to be sent immediately.

    .. deprecated:: 0.0.87
        This frame is deprecated and will be removed in a future version.
        Instead, use `OutputTransportMessageUrgentFrame`.

    Parameters:
        message: The urgent transport message payload.
    c                     t         |           dd l}|j                         5  |j	                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   z|TransportMessageUrgentFrame is deprecated and will be removed in a future version. Instead, use OutputTransportMessageFrame.r&   r'   r   r   s     r0   rZ   z)TransportMessageUrgentFrame.__post_init__  r2  r   r   r   s   @r0   r  r    r3  r;   r  c                        e Zd ZU dZeed<   dZee   ed<   dZee	   ed<   dZ
ee   ed<   dZee   ed<   dZee   ed<   dZee   ed	<   dZee   ed
<    fdZd Z xZS )UserImageRequestFramea%  Frame requesting an image from a specific user.

    A frame to request an image from the given user. The request might come with
    a text that can be later used to describe the requested image.

    Parameters:
        user_id: Identifier of the user to request image from.
        text: An optional text associated to the image request.
        append_to_context: Whether the requested image should be appended to the LLM context.
        video_source: Specific video source to capture from.
        function_name: Name of function that generated this request (if any).
        tool_call_id: Tool call ID if generated by function call (if any).
        result_callback: Optional callback to invoke when the image is retrieved.
        context: [DEPRECATED] Optional context for the image request.
    r   Nr   r   video_sourcer   r!  result_callbackr   c                     t         |           | j                  rGdd l}|j	                         5  |j                  d       |j                  dt        d       d d d        y y # 1 sw Y   y xY w)Nr   r%   z6`UserImageRequestFrame` field `context` is deprecated.r&   r'   )r   rZ   r   r*   r+   r,   r-   r.   r   s     r0   rZ   z#UserImageRequestFrame.__post_init__   sk    <<((* %%h/L&      s   *A$$A-c           
          | j                    d| j                   d| j                   d| j                   d| j                   d
S )Nr   , text: r   z, r   )r?   r   r   r   r  rY   s    r0   r]   zUserImageRequestFrame.__str__  s\    ))GDLL>$))DYZ^ZpZpYqqstx  uF  uF  tG  GH  I  	Ir;   )rC   rD   rE   rF   r`   r_   r   r   r   r   r  r   r!  r  r   r   rZ   r]   r   r   s   @r0   r  r    s}      LD(3-(,x~,"&L(3-&#'M8C='"&L(3-&%)OXc])!GXc]!Ir;   r  c                   (     e Zd ZdZ fdZd Z xZS )InputAudioRawFramezRaw audio input frame from transport.

    A chunk of audio usually coming from an input transport. If the transport
    supports multiple audio sources (e.g. multiple audio tracks) the source name
    will be specified in transport_source.
    c                     t         |           t        t        | j                        | j
                  dz  z        | _        y rv   r   r   s    r0   rZ   z InputAudioRawFrame.__post_init__  r   r;   c                     t        | j                        }| j                   d| d| j                   dt	        | j
                         d| j                   d| j                   d| j                   dS )Nr   
, source: r   r   r   r   r   )	rL   rJ   r?   rT   rw   ro   rt   rp   rq   r   s     r0   r]   zInputAudioRawFrame.__str__  s    "))F3%z$2G2G1HQTUYU_U_Q`Paaklpl{l{k|  }L  MQ  M]  M]  L^  ^j  ko  k|  k|  j}  }~    	r;   r   r   s   @r0   r  r    s    Ir;   r  c                       e Zd ZdZd Zy)InputImageRawFramezRaw image input frame from transport.

    An image usually coming from an input transport. If the transport
    supports multiple video sources (e.g. multiple video tracks) the source name
    will be specified in transport_source.
    c           
          t        | j                        }| j                   d| d| j                   d| j                   d| j
                   d
S )Nr   r  r   r   r   )rL   rJ   r?   rT   r|   r}   r   s     r0   r]   zInputImageRawFrame.__str__-  sR    "))F3%z$2G2G1HQUQZQZP[[efjfqfqerrsttr;   Nr   rI   r;   r0   r  r  $  s    ur;   r  c                       e Zd ZdZd Zy)InputTextRawFramea  Raw text input frame from transport.

    Text input usually coming from user typing or programmatic text injection
    that should be sent to LLM services as input, similar to how InputAudioRawFrame
    and InputImageRawFrame represent user audio and video input.
    c                     t        | j                        }| j                   d| d| j                   d| j                   dS )Nr   r  r   r   )rL   rJ   r?   rT   r   r   s     r0   r]   zInputTextRawFrame.__str__;  sC    "))F3%z$2G2G1H	RVR[R[Q\\^__r;   Nr   rI   r;   r0   r  r  2  s    `r;   r  c                   &    e Zd ZU dZdZeed<   d Zy)UserAudioRawFramezRaw audio input frame associated with a specific user.

    A chunk of audio, usually coming from an input transport, associated to a user.

    Parameters:
        user_id: Identifier of the user who provided this audio.
     r   c                     t        | j                        }| j                   d| d| j                   d| j                   dt        | j                         d| j                   d| j                   d| j                   dS )	Nr   , user: r  r   r   r   r   r   )
rL   rJ   r?   r   rT   rw   ro   rt   rp   rq   r   s     r0   r]   zUserAudioRawFrame.__str__L  s    "))F3%x~ZH]H]G^^fgjkokukugvfw  xB  CG  CR  CR  BS  Sb  cg  cs  cs  bt  t@  AE  AR  AR  @S  ST  U  	Ur;   N)rC   rD   rE   rF   r   r`   r_   r]   rI   r;   r0   r  r  @  s     GSUr;   r  c                   b    e Zd ZU dZdZeed<   dZee   ed<   dZ	ee
   ed<   dZee   ed<   d Zy)	UserImageRawFramea  Raw image input frame associated with a specific user.

    An image associated to a user, potentially in response to an image request.

    Parameters:
        user_id: Identifier of the user who provided this image.
        text: An optional text associated to this image.
        append_to_context: Whether the requested image should be appended to the LLM context.
        request: The original image request frame if this is a response.
    r  r   Nr   r   requestc                     t        | j                        }| j                   d| d| j                   d| j                   d| j
                   d| j                   d| j                   d| j                   dS )	Nr   r  r  r   r   r  r   r   )	rL   rJ   r?   r   rT   r|   r}   r   r   r   s     r0   r]   zUserImageRawFrame.__str__c  s    "))F3%x~ZH]H]G^^fgkgpgpfqq{  }A  }H  }H  |I  IQ  RV  R[  R[  Q\  \q  rv  rH  rH  qI  IJ  K  	Kr;   )rC   rD   rE   rF   r   r`   r_   r   r   r   r   r  r  r]   rI   r;   r0   r  r  Q  sF    	 GSD(3-(,x~,/3GX+,3Kr;   r  c                   :    e Zd ZU dZdZee   ed<   dZee	   ed<   y)AssistantImageRawFramea  Frame containing an image generated by the assistant.

    Contains both the raw frame for display (superclass functionality) as well
    as the original image, which can get used directly in LLM contexts.

    Parameters:
        original_data: The original image data, which can get used directly in
            an LLM context message without further encoding.
        original_mime_type: The MIME type of the original image data.
    Noriginal_dataoriginal_mime_type)
rC   rD   rE   rF   r  r   rx   r_   r  r`   rI   r;   r0   r  r  h  s&    	 &*M8E?)(,,r;   r  c                       e Zd ZdZy)InputDTMFFramez)DTMF keypress input frame from transport.Nrc   rI   r;   r0   r  r  y  s    3r;   r  c                       e Zd ZdZy)OutputDTMFUrgentFramea  DTMF keypress output frame for immediate sending.

    A DTMF keypress output that will be sent right away. If your transport
    supports multiple dial-out destinations, use the `transport_destination`
    field to specify where the DTMF keypress should be sent.
    Nrc   rI   r;   r0   r  r    rg   r;   r  c                   :    e Zd ZU dZdZee   ed<   dZee	   ed<   y)SpeechControlParamsFramea  Frame for notifying processors of speech control parameter changes.

    This includes parameters for both VAD (Voice Activity Detection) and
    turn-taking analysis. It allows downstream processors to adjust their
    behavior based on updated interaction control settings.

    Parameters:
        vad_params: Current VAD parameters.
        turn_params: Current turn-taking analysis parameters.
    N
vad_paramsturn_params)
rC   rD   rE   rF   r  r   r   r_   r  r   rI   r;   r0   r  r    s'    	 '+J#*,0K.)0r;   r  c                       e Zd ZU dZeed<   y)ServiceMetadataFramea  Base metadata frame for services.

    Broadcast by services at pipeline start to share service-specific
    configuration and performance characteristics with downstream processors.

    Parameters:
        service_name: The name of the service broadcasting this metadata.
    service_nameNr   rI   r;   r0   r  r    s     r;   r  c                       e Zd ZU dZeed<   y)STTMetadataFramea  Metadata from STT service.

    Broadcast by STT services to inform downstream processors (like turn
    strategies) about STT latency characteristics.

    Parameters:
        ttfs_p99_latency: Time to final segment P99 latency in seconds.
            This is the expected time from when speech ends to when the
            final transcript is received, at the 99th percentile.
    ttfs_p99_latencyNrC   rD   rE   rF   r  r_   rI   r;   r0   r  r    s    	 r;   r  c                       e Zd ZU dZded<   y)#ServiceSwitcherRequestMetadataFramea  Request a service to re-emit its metadata frames.

    Used by ServiceSwitcher when switching active services to ensure
    downstream processors receive updated metadata from the newly active service.
    Services that receive this frame should re-push their metadata frame
    (e.g., STTMetadataFrame for STT services).

    Parameters:
        service: The target service that should re-emit its metadata.
    r   serviceNr   rI   r;   r0   r  r    s    	 r;   r  c                       e Zd ZdZy)	TaskFramea'  Base frame for task frames.

    This is a base class for frames that are meant to be sent and handled
    upstream by the pipeline task. This might result in a corresponding frame
    sent downstream (e.g. `InterruptionTaskFrame` / `InterruptionFrame` or
    `EndTaskFrame` / `EndFrame`).

    Nrc   rI   r;   r0   r  r    rj   r;   r  c                   ,    e Zd ZU dZdZee   ed<   d Zy)EndTaskFrameaJ  Frame to request graceful pipeline task closure.

    This is used to notify the pipeline task that the pipeline should be
    closed nicely (flushing all the queued frames) by pushing an EndFrame
    downstream. This frame should be pushed upstream.

    Parameters:
        reason: Optional reason for pushing an end frame.
    NrI  c                 :    | j                    d| j                   dS rK  rL  rY   s    r0   r]   zEndTaskFrame.__str__  rM  r;   rN  rI   r;   r0   r  r         !FHSM 5r;   r  c                   ,    e Zd ZU dZdZee   ed<   d Zy)CancelTaskFramea9  Frame to request immediate pipeline task cancellation.

    This is used to notify the pipeline task that the pipeline should be
    stopped immediately by pushing a CancelFrame downstream. This frame
    should be pushed upstream.

    Parameters:
        reason: Optional reason for pushing a cancel frame.
    NrI  c                 :    | j                    d| j                   dS rK  rL  rY   s    r0   r]   zCancelTaskFrame.__str__  rM  r;   rN  rI   r;   r0   r  r    r  r;   r  c                       e Zd ZdZy)StopTaskFramea=  Frame to request pipeline task stop while keeping processors running.

    This is used to notify the pipeline task that it should be stopped as
    soon as possible (flushing all the queued frames) but that the pipeline
    processors should be kept in a running state. This frame should be pushed
    upstream.
    Nrc   rI   r;   r0   r  r    r  r;   r  c                       e Zd ZdZy)InterruptionTaskFramezFrame indicating the pipeline should be interrupted.

    This frame should be pushed upstream to indicate the pipeline should be
    interrupted. The pipeline task converts this into an `InterruptionFrame`
    and sends it downstream.
    Nrc   rI   r;   r0   r  r    rg   r;   r  c                   "     e Zd ZdZ fdZ xZS )BotInterruptionFramea  Frame indicating the bot should be interrupted.

    .. deprecated:: 0.0.85
        This frame is deprecated and will be removed in a future version.
        Instead, use `InterruptionTaskFrame`.

    Emitted when the bot should be interrupted. This will mainly cause the
    same actions as if the user interrupted except that the
    UserStartedSpeakingFrame and UserStoppedSpeakingFrame won't be generated.
    This frame should be pushed upstream.
    c                     t         |           dd l}|j                         5  |j	                  d       |j                  dt        d       d d d        y # 1 sw Y   y xY w)Nr   r%   zoBotInterruptionFrame is deprecated and will be removed in a future version. Instead, use InterruptionTaskFrame.r&   r'   r   r   s     r0   rZ   z"BotInterruptionFrame.__post_init__)  s\    $$& 	!!(+MM6"	  	 	 	r   r   r   s   @r0   r  r    rd  r;   r  c                   ,    e Zd ZU dZdZee   ed<   d Zy)EndFramea  Frame indicating pipeline has ended and should shut down.

    Indicates that a pipeline has ended and frame processors and pipelines
    should be shut down. If the transport receives this frame, it will stop
    sending frames to its output channel(s) and close all its threads. Note,
    that this is a control frame, which means it will be received in the order it
    was sent.

    This frame is marked as UninterruptibleFrame to ensure it is not lost when
    an InterruptionFrame is processed. Terminal frames must survive interruption
    to guarantee proper pipeline shutdown.

    Parameters:
        reason: Optional reason for pushing an end frame.
    NrI  c                 :    | j                    d| j                   dS rK  rL  rY   s    r0   r]   zEndFrame.__str__P  rM  r;   rN  rI   r;   r0   r  r  <  s      !FHSM 5r;   r  c                       e Zd ZdZy)	StopFramea  Frame indicating pipeline should stop but keep processors running.

    Indicates that a pipeline should be stopped but that the pipeline
    processors should be kept in a running state. This is normally queued from
    the pipeline task.

    This frame is marked as UninterruptibleFrame to ensure it is not lost when
    an InterruptionFrame is processed. Terminal frames must survive interruption
    to guarantee proper pipeline control.
    Nrc   rI   r;   r0   r  r  T  s    	 	r;   r  c                       e Zd ZdZy)BotConnectedFramezFrame indicating the bot has connected to the transport service.

    Pushed downstream by SFU transports (Daily, LiveKit, HeyGen, Tavus)
    when the bot successfully joins the room. Non-SFU transports do not
    emit this frame.
    Nrc   rI   r;   r0   r  r  d  rg   r;   r  c                       e Zd ZdZy)ClientConnectedFramezFrame indicating that a client has connected to the transport.

    Pushed downstream by the input transport when a client (participant)
    connects. Used by observers to measure transport readiness timing.
    Nrc   rI   r;   r0   r  r  p  rd   r;   r  c                       e Zd ZdZy)OutputTransportReadyFramezFrame indicating that the output transport is ready.

    Indicates that the output transport is ready and able to receive frames.
    Nrc   rI   r;   r0   r  r  {  rr  r;   r  c                       e Zd ZU dZeed<   y)HeartbeatFramezFrame used by pipeline task to monitor pipeline health.

    This frame is used by the pipeline task as a mechanism to know if the
    pipeline is running properly.

    Parameters:
        timestamp: Timestamp when the heartbeat was generated.
    r   N)rC   rD   rE   rF   r^   r_   rI   r;   r0   r  r    s     Nr;   r  c                       e Zd ZU dZded<   y)FrameProcessorPauseFrameaw  Frame to pause frame processing for a specific processor.

    This frame is used to pause frame processing for the given
    processor. Pausing frame processing will keep frames in the internal queue
    which will then be processed when frame processing is resumed with
    `FrameProcessorResumeFrame`.

    Parameters:
        processor: The frame processor to pause.
    r   rS  Nr   rI   r;   r0   r  r    r[  r;   r  c                       e Zd ZU dZded<   y)FrameProcessorResumeFrameaM  Frame to resume frame processing for a specific processor.

    This frame is used to resume frame processing for the given processor if
    it was previously paused. After resuming frame processing all queued frames
    will be processed in the order received.

    Parameters:
        processor: The frame processor to resume.
    r   rS  Nr   rI   r;   r0   r  r    r^  r;   r  c                   F     e Zd ZU dZ ed      Zee   ed<    fdZ	 xZ
S )LLMFullResponseStartFramezFrame indicating the beginning of an LLM response.

    Used to indicate the beginning of an LLM response. Followed by one or
    more TextFrames and a final LLMFullResponseEndFrame.
    FrO   r   c                 0    t         |           d | _        y r\   r   rZ   r   r   s    r0   rZ   z'LLMFullResponseStartFrame.__post_init__      r;   rC   rD   rE   rF   r   r   r   r   r_   rZ   r   r   s   @r0   r  r    s'      %%0Hhtn0 r;   r  c                   F     e Zd ZU dZ ed      Zee   ed<    fdZ	 xZ
S )LLMFullResponseEndFramez,Frame indicating the end of an LLM response.FrO   r   c                 0    t         |           d | _        y r\   r  r   s    r0   rZ   z%LLMFullResponseEndFrame.__post_init__  r  r;   r  r   s   @r0   r  r    s#    6$%0Hhtn0 r;   r  c                       e Zd ZdZy) LLMAssistantPushAggregationFrameaX  Frame that forces the LLM assistant aggregator to push its current aggregation to context.

    When received by ``LLMAssistantAggregator``, any text that has been accumulated
    in the aggregation buffer is immediately committed to the conversation context as
    an assistant message, without waiting for an ``LLMFullResponseEndFrame``.
    Nrc   rI   r;   r0   r   r     s    r;   r   c                   &    e Zd ZU dZdZed   ed<   y)LLMSummarizeContextFramea  Frame requesting on-demand context summarization.

    Push this frame into the pipeline to trigger a manual context summarization.

    Parameters:
        config: Optional per-request override for summary generation settings
            (prompt, token budget, messages to keep). If ``None``, the
            summarizer's default :class:`~pipecat.utils.context.llm_context_summarization.LLMContextSummaryConfig`
            is used.
    Nr    config)rC   rD   rE   rF   r  r   r_   rI   r;   r0   r  r    s    	 37FH./6r;   r  c                   X    e Zd ZU dZeed<   ded<   eed<   eed<   eed<   dZee	   ed	<   y)
LLMContextSummaryRequestFrameac  Frame requesting context summarization from an LLM service.

    Sent by aggregators to LLM services when conversation context needs to be
    compressed. The LLM service generates a summary of older messages while
    preserving recent conversation history.

    Parameters:
        request_id: Unique identifier to match this request with its response.
            Used to handle async responses and avoid race conditions.
        context: The full LLM context containing all messages to analyze and summarize.
        min_messages_to_keep: Number of recent messages to preserve uncompressed.
            These messages will not be included in the summary.
        target_context_tokens: Maximum token size for the generated summary. This value
            is passed directly to the LLM as the max_tokens parameter when generating
            the summary text.
        summarization_prompt: System prompt instructing the LLM how to generate
            the summary.
        summarization_timeout: Maximum time in seconds for the LLM to generate a
            summary. When None, a default timeout of 120s is applied.
    
request_idr   r   min_messages_to_keeptarget_context_tokenssummarization_promptNsummarization_timeout)
rC   rD   rE   rF   r`   r_   r^   r
  r   r  rI   r;   r0   r  r    s5    * O-18E?1r;   r  c                   D    e Zd ZU dZeed<   eed<   eed<   dZee   ed<   y)LLMContextSummaryResultFramea  Frame containing the result of context summarization.

    Sent by LLM services back to aggregators after generating a summary.
    Contains the formatted summary message and metadata about what was summarized.

    Parameters:
        request_id: Identifier matching the original request. Used to correlate
            async responses.
        summary: The formatted summary message ready to be inserted into context.
        last_summarized_index: Index (0-based) of the last message that was
            included in the summary. Messages after this index are preserved.
        error: Error message if summarization failed, None on success.
    r  summarylast_summarized_indexNrQ  )	rC   rD   rE   rF   r`   r_   r^   rQ  r   rI   r;   r0   r  r    s'     OLE8C=r;   r  c                   >    e Zd ZU dZeed<   eed<   eed<   dZeed<   y)FunctionCallInProgressFramea  Frame signaling that a function call is currently executing.

    This is an uninterruptible frame because we always want to update the
    context.

    Parameters:
        function_name: Name of the function being executed.
        tool_call_id: Unique identifier for this function call.
        arguments: Arguments passed to the function.
        cancel_on_interruption: Whether to cancel this call if interrupted.
    r   r!  r"  Fcancel_on_interruptionN)	rC   rD   rE   rF   r`   r_   r   r  r   rI   r;   r0   r  r    s%    
 N#(D(r;   r  c                       e Zd ZdZy)VisionFullResponseStartFramezFrame indicating the beginning of a vision model response.

    Used to indicate the beginning of a vision model response. Followed by one
    or more VisionTextFrames and a final VisionFullResponseEndFrame.

    Nrc   rI   r;   r0   r  r  /  rg   r;   r  c                       e Zd ZdZy)VisionFullResponseEndFramez4Frame indicating the end of a Vision model response.Nrc   rI   r;   r0   r  r  ;  s    >r;   r  c                   &    e Zd ZU dZdZee   ed<   y)TTSStartedFramea  Frame indicating the beginning of a TTS response.

    Used to indicate the beginning of a TTS response. Following
    TTSAudioRawFrames are part of the TTS response until a
    TTSStoppedFrame. These frames can be used for aggregating audio frames in a
    transport to optimize the size of frames sent to the session, without
    needing to control this in the TTS service.

    Parameters:
        context_id: Unique identifier for this TTS context.
    Nr   r   rI   r;   r0   r  r  B  s    
 !%J$r;   r  c                   &    e Zd ZU dZdZee   ed<   y)TTSStoppedFramez}Frame indicating the end of a TTS response.

    Parameters:
        context_id: Unique identifier for this TTS context.
    Nr   r   rI   r;   r0   r  r  S  r   r;   r  c                   L    e Zd ZU dZ ee      Zeee	f   e
d<   dZed   e
d<   y)ServiceUpdateSettingsFramea   Base frame for updating service settings.

    Supports both a ``settings`` dict (for backward compatibility) and a
    ``delta`` object.  When both are provided, ``delta`` takes precedence.

    Parameters:
        settings: Dictionary of setting name to value mappings.

            .. deprecated:: 0.0.104
                Use ``delta`` with a typed settings object instead.

        delta: :class:`~pipecat.services.settings.ServiceSettings` delta-mode
            object describing the fields to change.
    rA  settingsNr   delta)rC   rD   rE   rF   r   r  r  r   r`   r   r_   r  r   rI   r;   r0   r  r  ^  s1     #("=Hgc3h=)-E8%&-r;   r  c                       e Zd ZdZy)LLMUpdateSettingsFramez(Frame for updating LLM service settings.Nrc   rI   r;   r0   r  r  s  r   r;   r  c                       e Zd ZdZy)TTSUpdateSettingsFramez(Frame for updating TTS service settings.Nrc   rI   r;   r0   r!  r!  z  r   r;   r!  c                       e Zd ZdZy)STTUpdateSettingsFramez(Frame for updating STT service settings.Nrc   rI   r;   r0   r#  r#    r   r;   r#  c                       e Zd ZU dZeed<   y)UserIdleTimeoutUpdateFramezFrame for updating the user idle timeout at runtime.

    Setting timeout to 0 disables idle detection. Setting a positive value
    enables it.

    Parameters:
        timeout: The new idle timeout in seconds. 0 disables idle detection.
    timeoutNr  rI   r;   r0   r%  r%    s     Nr;   r%  c                       e Zd ZU dZeed<   y)VADParamsUpdateFramezFrame for updating VAD parameters.

    A control frame containing a request to update VAD params. Intended
    to be pushed upstream from RTVI processor.

    Parameters:
        params: New VAD parameters to apply.
    paramsN)rC   rD   rE   rF   r   r_   rI   r;   r0   r(  r(    s     r;   r(  c                       e Zd ZdZy)FilterControlFramez/Base control frame for audio filter operations.Nrc   rI   r;   r0   r+  r+    s    9r;   r+  c                   &    e Zd ZU dZeeef   ed<   y)FilterUpdateSettingsFramezFrame for updating audio filter settings.

    Parameters:
        settings: Dictionary of filter setting name to value mappings.
    r  NrC   rD   rE   rF   r   r`   r   r_   rI   r;   r0   r-  r-         c3hr;   r-  c                       e Zd ZU dZeed<   y)FilterEnableFramezFrame for enabling/disabling audio filters at runtime.

    Parameters:
        enable: Whether to enable (True) or disable (False) the filter.
    r  Nr  rI   r;   r0   r1  r1    r  r;   r1  c                       e Zd ZdZy)MixerControlFramez.Base control frame for audio mixer operations.Nrc   rI   r;   r0   r3  r3    s    8r;   r3  c                   &    e Zd ZU dZeeef   ed<   y)MixerUpdateSettingsFramezFrame for updating audio mixer settings.

    Parameters:
        settings: Dictionary of mixer setting name to value mappings.
    r  Nr.  rI   r;   r0   r5  r5    r/  r;   r5  c                       e Zd ZU dZeed<   y)MixerEnableFramezFrame for enabling/disabling audio mixer at runtime.

    Parameters:
        enable: Whether to enable (True) or disable (False) the mixer.
    r  Nr  rI   r;   r0   r7  r7    r  r;   r7  c                       e Zd ZdZy)ServiceSwitcherFramez=A base class for frames that affect ServiceSwitcher behavior.Nrc   rI   r;   r0   r9  r9    s    Gr;   r9  c                       e Zd ZU dZded<   y)ManuallySwitchServiceFramezA frame to request a manual switch in the active service in a ServiceSwitcher.

    Handled by ServiceSwitcherStrategyManual to switch the active service.
    r   r  Nr   rI   r;   r0   r;  r;    s    
 r;   r;  )rF   r  dataclassesr   r   typingr   r   r   r   r	   r
   r   r   r   r   r   %pipecat.adapters.schemas.tools_schemar   pipecat.audio.dtmf.typesr   rG   6pipecat.audio.interruptions.base_interruption_strategyr   %pipecat.audio.turn.base_turn_analyzerr   pipecat.audio.vad.vad_analyzerr   pipecat.metrics.metricsr   pipecat.transcriptions.languager   'pipecat.utils.text.base_text_aggregatorr   pipecat.utils.timer   pipecat.utils.utilsr   r   *pipecat.processors.aggregators.llm_contextr   r   "pipecat.processors.frame_processorr   pipecat.services.settingsr   /pipecat.utils.context.llm_context_summarizationr    %pipecat.utils.tracing.tracing_contextr!   r#   r^   rL   rN   rb   rf   ri   rl   rn   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r
  r  r  r  r  r  r  r%  r'  r0  r5  r8  r:  rH  rP  rX  rZ  r]  r`  rb  rf  rk  rm  ro  rq  rt  ry  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r!  r#  r%  r(  r+  r-  r1  r3  r5  r7  r9  r;  rI   r;   r0   <module>rM     s2    (    > B [ @ 4 / 4 C 1 1OA9WD2  2 j $%4HSM 4 $ $ $N 	% 	 	 	 	 	 
	5 
	 
	$ 
	 
	 
	 I I I&   & I)] I I" 
)] 
 
 	%* 	% 	% 	 3 	 	 e* e e" D) D D$ $?	 $? $?N 09 0 0 %) % % 	l 	 	 %& % % A A A2 A	 A A0 Ay A A( i  : 	        F   2 AJy AJ AJH 
e 
 
 
< 
 
6 E) E E. G G G  "y " "J 	) 	 	 #Y # # #Y # # 1y 1 1 <I < < )   i   	G 	G 	G >i)= > >0 -I - - 
7) 
7 
7 7  2    	i 	 	  "7 "7 "7J 5+ 5 5  H H H. 
2j 
2 
2  [      k     	 	 	 .  6 {  " {  " 	; 	 	 	; 	 	 	 	 	 k  0 k  0 8+ 8 8 8+ 8 8 	k 	 	 	k 	 	 		{ 		 		 	; 	 	   $ 
2 
2 
2 	k 	 	 ;   
7 
7 
7 'A  2 
7 
7 
7 "C  2 )IK )I )IX m  " 
um 
u 
u 
`Y 
` 
` U* U U  K* K K, -0 - -  	Y 	 	 	I{ 	 	 1{ 1 1  
; 
 
 +   ,  ( 
	 
	 
	 59 5 5" 5i 5 5" 		I 		 		 	I 	 	 0  @ 5|1 5 5. 	2 	 	 	 	 	 	; 	 	 	 	 	 
\ 
 
  |              l   |   7| 7 7 2L 2 2<  <1E    * ),0D ) )& 	#< 	 	 	!8 	 	 %l % %  %l % % ./C . .( 	7 	 	 	7 	 	 	7 	 	 
 
 
 
< 
 
 	 	 	   2     *   	 	 	  0     (   	< 	 	 !5  r;   