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

import typing

import pydantic
from ....core.pydantic_utilities import IS_PYDANTIC_V2
from ....core.unchecked_base_model import UncheckedBaseModel
from .pulse_speech_to_text_response_age import PulseSpeechToTextResponseAge
from .pulse_speech_to_text_response_emotions import PulseSpeechToTextResponseEmotions
from .pulse_speech_to_text_response_gender import PulseSpeechToTextResponseGender
from .pulse_speech_to_text_response_metadata import PulseSpeechToTextResponseMetadata
from .pulse_speech_to_text_response_utterances_item import PulseSpeechToTextResponseUtterancesItem
from .pulse_speech_to_text_response_words_item import PulseSpeechToTextResponseWordsItem


class PulseSpeechToTextResponse(UncheckedBaseModel):
    status: typing.Optional[str] = pydantic.Field(default=None)
    """
    Status of the transcription request
    """

    transcription: typing.Optional[str] = pydantic.Field(default=None)
    """
    The transcribed text from the audio file
    """

    audio_length: typing.Optional[float] = pydantic.Field(default=None)
    """
    Duration of the audio file in seconds
    """

    words: typing.Optional[typing.List[PulseSpeechToTextResponseWordsItem]] = pydantic.Field(default=None)
    """
    Word-level timestamps in seconds.
    """

    utterances: typing.Optional[typing.List[PulseSpeechToTextResponseUtterancesItem]] = pydantic.Field(default=None)
    """
    List of utterances with start and end times
    """

    age: typing.Optional[PulseSpeechToTextResponseAge] = pydantic.Field(default=None)
    """
    Predicted age group of the speaker (e.g., infant, teenager, adult, old)
    """

    gender: typing.Optional[PulseSpeechToTextResponseGender] = pydantic.Field(default=None)
    """
    Predicted gender of the speaker if requested
    """

    emotions: typing.Optional[PulseSpeechToTextResponseEmotions] = pydantic.Field(default=None)
    """
    Predicted emotions of the speaker if requested
    """

    metadata: typing.Optional[PulseSpeechToTextResponseMetadata] = pydantic.Field(default=None)
    """
    Metadata about the transcription
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
