# 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 .provided_extraction_field_result_type import ProvidedExtractionFieldResultType


class ProvidedExtractionFieldResult(UncheckedBaseModel):
    id: str = pydantic.Field()
    """
    The unique identifier for this field
    """

    value: typing.Optional[typing.Any] = None
    type: typing.Optional[ProvidedExtractionFieldResultType] = pydantic.Field(default=None)
    """
    The type of the extraction field result
    """

    confidence: typing.Optional[float] = pydantic.Field(default=None)
    """
    A value between 0 and 1 indicating confidence in the extraction. Will be set to 1 if not provided.
    """

    page: typing.Optional[float] = pydantic.Field(default=None)
    """
    The page number where this field was extracted from
    """

    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
