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

import typing

import typing_extensions
from ..types.legacy_extraction_field_result_type import LegacyExtractionFieldResultType
from .enum_option import EnumOptionParams
from .extraction_field_result_reference import ExtractionFieldResultReferenceParams
from .insight import InsightParams
from .legacy_extraction_field import LegacyExtractionFieldParams


class LegacyExtractionFieldResultParams(typing_extensions.TypedDict):
    id: str
    """
    The unique identifier for this field
    """

    type: LegacyExtractionFieldResultType
    """
    The type of the extracted field
    """

    value: typing.Any
    confidence: typing_extensions.NotRequired[float]
    """
    A value between 0 and 1 indicating confidence in the extraction
    """

    schema: typing_extensions.NotRequired[typing.Sequence[LegacyExtractionFieldParams]]
    """
    The field schema of nested fields
    """

    insights: typing_extensions.NotRequired[typing.Sequence[InsightParams]]
    """
    Reasoning and other insights from the model
    """

    references: typing.Sequence[ExtractionFieldResultReferenceParams]
    """
    References for the extracted field
    """

    enum: typing_extensions.NotRequired[typing.Sequence[EnumOptionParams]]
    """
    The enum options for enum fields, only set when type=enum
    """
