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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.serialization import FieldMetadata
from ..core.unchecked_base_model import UncheckedBaseModel
from .bounding_box import BoundingBox


class ParseRunOutputOcrWordsItem(UncheckedBaseModel):
    content: str = pydantic.Field()
    """
    The text content of the word.
    """

    bounding_box: typing_extensions.Annotated[BoundingBox, FieldMetadata(alias="boundingBox")] = pydantic.Field(
        alias="boundingBox"
    )
    """
    The bounding box coordinates of the word.
    """

    confidence: float = pydantic.Field()
    """
    The confidence score of the OCR detection for this word, between 0 and 1.
    """

    page_number: typing_extensions.Annotated[float, FieldMetadata(alias="pageNumber")] = pydantic.Field(
        alias="pageNumber"
    )
    """
    The page number where the word was detected.
    """

    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
