# 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 .lightning_transcription_response_message_utterances_item import (
    LightningTranscriptionResponseMessageUtterancesItem,
)
from .lightning_transcription_response_message_words_item import LightningTranscriptionResponseMessageWordsItem


class LightningTranscriptionResponseMessage(UncheckedBaseModel):
    session_id: str = pydantic.Field()
    """
    Unique identifier for the transcription session
    """

    transcript: typing.Optional[str] = pydantic.Field(default=None)
    """
    Partial or complete transcription text for the current segment
    """

    full_transcript: typing.Optional[str] = pydantic.Field(default=None)
    """
    Complete transcription text accumulated so far. Only included when `full_transcript` query parameter is set to true AND is_final=true
    """

    is_final: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates if this is the final transcription for the current segment
    """

    is_last: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates if this is the last transcription in the session
    """

    words: typing.Optional[typing.List[LightningTranscriptionResponseMessageWordsItem]] = pydantic.Field(default=None)
    """
    Word-level timestamps (when word_timestamps=true)
    """

    utterances: typing.Optional[typing.List[LightningTranscriptionResponseMessageUtterancesItem]] = pydantic.Field(
        default=None
    )
    """
    Sentence-level timestamps (when sentence_timestamps=true)
    """

    language: typing.Optional[str] = pydantic.Field(default=None)
    """
    Detected primary language code, only returned when `is_final=True`
    """

    languages: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    List of codes of languages detected in the audio, only returned when `is_final=True`
    """

    redacted_entities: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    List of redacted entity placeholders (when redact_pii or redact_pci is enabled)
    """

    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
