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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class Utterance(UniversalBaseModel):
    """
    A single utterance for topic segmentation.
    """

    text: str = pydantic.Field()
    """
    Utterance text content
    """

    start_ms: int = pydantic.Field()
    """
    Start time in milliseconds
    """

    end_ms: int = pydantic.Field()
    """
    End time in milliseconds
    """

    speaker: typing.Optional[str] = pydantic.Field(default=None)
    """
    Speaker label
    """

    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
