# This file was auto-generated by Fern from our API Definition.

import typing

import typing_extensions
from .speak_v2speech_interrupted_metadata import SpeakV2SpeechInterruptedMetadataParams


class SpeakV2SpeechInterruptedParams(typing_extensions.TypedDict):
    type: typing.Literal["SpeechInterrupted"]
    """
    Message type identifier
    """

    audio_played_ms: int
    """
    How much audio the client had played when the interrupt landed, in milliseconds from the start of the session. Echoes the `Interrupt`'s `playback_offset` when one was supplied. Otherwise it is the server's own total, representing the audio that has been generated so far. A client that sends its first `Interrupt` without an offset can use this value as the baseline the next one must advance past.
    """

    text_spoken: typing_extensions.NotRequired[str]
    """
    The portion of the turn's text the user heard. Omitted when the `Interrupt` carried no `playback_offset`.
    """

    text_remaining: typing_extensions.NotRequired[str]
    """
    The portion of the turn's text the user did not hear. Omitted when the `Interrupt` carried no `playback_offset`.
    """

    metadata: SpeakV2SpeechInterruptedMetadataParams
    """
    Billing and timing for a single turn.
    """
