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

import typing

import typing_extensions
from ..core.serialization import FieldMetadata
from .insight import InsightParams
from .legacy_json_output_metadata_value_citations_item import LegacyJsonOutputMetadataValueCitationsItemParams


class LegacyJsonOutputMetadataValueParams(typing_extensions.TypedDict):
    ocr_confidence: typing_extensions.NotRequired[
        typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="ocrConfidence")]
    ]
    """
    Confidence score from OCR processing, if applicable
    """

    logprobs_confidence: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="logprobsConfidence")]
    """
    Confidence score based on model logprobs
    """

    review_agent_score: typing_extensions.NotRequired[
        typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="reviewAgentScore")]
    ]
    """
    A 1-5 score indicating the review agent's confidence in the extracted value.
    - 5: High confidence, no issues detected
    - 4: Good confidence, minor observations
    - 3: Moderate confidence, some uncertainty
    - 2: Low confidence, likely issues
    - 1: Very low confidence, significant problems detected
    
    These scores will be present when the `reviewAgent.enabled` flag is set to `true` in the processor config.
    If the review agent is enabled but a score is not returned for a field, this value will be `null`.
    To learn more, view the [Review Agent Documentation](https://docs.extend.ai/2026-02-09/product/extraction/review-agent)
    """

    citations: typing_extensions.NotRequired[typing.Sequence[LegacyJsonOutputMetadataValueCitationsItemParams]]
    insights: typing_extensions.NotRequired[typing.Sequence[InsightParams]]
