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

import typing

import typing_extensions
from .listen_v1results_channel import ListenV1ResultsChannelParams
from .listen_v1results_entities_item import ListenV1ResultsEntitiesItemParams
from .listen_v1results_metadata import ListenV1ResultsMetadataParams


class ListenV1ResultsParams(typing_extensions.TypedDict):
    type: typing.Literal["Results"]
    """
    Message type identifier
    """

    channel_index: typing.Sequence[float]
    """
    The index of the channel
    """

    duration: float
    """
    The duration of the transcription
    """

    start: float
    """
    The start time of the transcription
    """

    is_final: typing_extensions.NotRequired[bool]
    """
    Whether the transcription is final
    """

    speech_final: typing_extensions.NotRequired[bool]
    """
    Whether the transcription is speech final
    """

    channel: ListenV1ResultsChannelParams
    metadata: ListenV1ResultsMetadataParams
    from_finalize: typing_extensions.NotRequired[bool]
    """
    Whether the transcription is from a finalize message
    """

    entities: typing_extensions.NotRequired[typing.Sequence[ListenV1ResultsEntitiesItemParams]]
    """
    Extracted entities from the audio when detect_entities is enabled. Only present in is_final messages. Returns an empty array if no entities are detected
    """
