Ë
    ±q±ió  ã                   ó.   — d Z ddlmZmZ  G d„ de«      Zy)zOBase interruption strategy for determining when users can interrupt bot speech.é    )ÚABCÚabstractmethodc                   óR   — e Zd ZdZdedefd„Zdefd„Ze	de
fd„«       Ze	d	„ «       Zy
)ÚBaseInterruptionStrategyaE  Base class for interruption strategies.

    This is a base class for interruption strategies. Interruption strategies
    decide when the user can interrupt the bot while the bot is speaking. For
    example, there could be strategies based on audio volume or strategies based
    on the number of words the user spoke.
    ÚaudioÚsample_ratec              ƒ   ó   K  — y­w)a  Append audio data to the strategy for analysis.

        Not all strategies handle audio. Default implementation does nothing.

        Args:
            audio: Raw audio bytes to append.
            sample_rate: Sample rate of the audio data in Hz.
        N© )Úselfr   r   s      úh/opt/pipecat/venv/lib/python3.12/site-packages/pipecat/audio/interruptions/base_interruption_strategy.pyÚappend_audioz%BaseInterruptionStrategy.append_audio   s   è ø€ ð 	ùó   ‚Útextc              ƒ   ó   K  — y­w)zÊAppend text data to the strategy for analysis.

        Not all strategies handle text. Default implementation does nothing.

        Args:
            text: Text string to append for analysis.
        Nr
   )r   r   s     r   Úappend_textz$BaseInterruptionStrategy.append_text    s   è ø€ ð 	ùr   Úreturnc              ƒ   ó   K  — y­w)aZ  Determine if the user should interrupt the bot.

        This is called when the user stops speaking and it's time to decide
        whether the user should interrupt the bot. The decision will be based on
        the aggregated audio and/or text.

        Returns:
            True if the user should interrupt the bot, False otherwise.
        Nr
   ©r   s    r   Úshould_interruptz)BaseInterruptionStrategy.should_interrupt*   s   è ø€ ð 	ùr   c              ƒ   ó   K  — y­w)z0Reset the current accumulated text and/or audio.Nr
   r   s    r   ÚresetzBaseInterruptionStrategy.reset7   s   è ø€ ð 	ùr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚbytesÚintr   Ústrr   r   Úboolr   r   r
   ó    r   r   r      sU   „ ñð	¨ð 	¸Có 	ð có ð ð
¨ò 
ó ð
ð ñó ñr    r   N)r   Úabcr   r   r   r
   r    r   ú<module>r"      s   ðñ Vç #ô.˜sõ .r    