# 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 ListenV1ResultsEntitiesItem(UniversalBaseModel):
    label: str = pydantic.Field()
    """
    The type/category of the entity (e.g., NAME, PHONE_NUMBER, EMAIL_ADDRESS, ORGANIZATION, CARDINAL)
    """

    value: str = pydantic.Field()
    """
    The formatted text representation of the entity
    """

    raw_value: str = pydantic.Field()
    """
    The original spoken text of the entity (present when formatting is enabled)
    """

    confidence: float = pydantic.Field()
    """
    The confidence score of the entity detection
    """

    start_word: int = pydantic.Field()
    """
    The index of the first word of the entity in the transcript (inclusive)
    """

    end_word: int = pydantic.Field()
    """
    The index of the last word of the entity in the transcript (exclusive)
    """

    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
