# 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 .transcript_message import TranscriptMessage


class UserTranscriptPayload(UncheckedBaseModel):
    """
    Payload containing the full conversation history sent by ElevenLabs each time
    the user finishes speaking.
    """

    type: typing.Literal["user_transcript"] = pydantic.Field(default="user_transcript")
    """
    The message type identifier.
    """

    user_transcript: typing.List[TranscriptMessage] = pydantic.Field()
    """
    Full conversation history up to and including the latest user turn, ordered
    chronologically. Contains both `user` and `agent` turns.
    """

    event_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Monotonically increasing identifier for this transcript event. Pass this value
    back in every `agent_response` message so ElevenLabs can correlate responses and
    discard any that belong to an interrupted turn.
    """

    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
