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

import typing

import typing_extensions
from ..core.serialization import FieldMetadata
from ..types.legacy_extraction_advanced_options_array_citation_strategy import (
    LegacyExtractionAdvancedOptionsArrayCitationStrategy,
)
from ..types.legacy_extraction_advanced_options_excel_sheet_selection_strategy import (
    LegacyExtractionAdvancedOptionsExcelSheetSelectionStrategy,
)
from .array_strategy import ArrayStrategyParams
from .excel_sheet_range import ExcelSheetRangeParams
from .legacy_extract_chunking_options import LegacyExtractChunkingOptionsParams
from .legacy_extraction_advanced_options_review_agent import LegacyExtractionAdvancedOptionsReviewAgentParams
from .page_ranges import PageRangesParams


class LegacyExtractionAdvancedOptionsParams(typing_extensions.TypedDict):
    document_kind: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="documentKind")]]
    """
    DEPRECATED - use extractionRules for all system prompts.
    """

    key_definitions: typing_extensions.NotRequired[
        typing_extensions.Annotated[str, FieldMetadata(alias="keyDefinitions")]
    ]
    """
    DEPRECATED - use extractionRules for all system prompts.
    """

    model_reasoning_insights_enabled: typing_extensions.NotRequired[
        typing_extensions.Annotated[bool, FieldMetadata(alias="modelReasoningInsightsEnabled")]
    ]
    """
    Whether to enable model reasoning insights.
    """

    advanced_multimodal_enabled: typing_extensions.NotRequired[
        typing_extensions.Annotated[bool, FieldMetadata(alias="advancedMultimodalEnabled")]
    ]
    """
    Whether to enable advanced multimodal features.
    """

    citations_enabled: typing_extensions.NotRequired[
        typing_extensions.Annotated[bool, FieldMetadata(alias="citationsEnabled")]
    ]
    """
    Whether to enable citations in the output.
    """

    array_citation_strategy: typing_extensions.NotRequired[
        typing_extensions.Annotated[
            LegacyExtractionAdvancedOptionsArrayCitationStrategy, FieldMetadata(alias="arrayCitationStrategy")
        ]
    ]
    """
    Granularity for array citations. This requires citationsEnabled=true and a base processor version that supports property-level array citations (extraction_performance ≥ 4.4.0).
    """

    advanced_figure_parsing_enabled: typing_extensions.NotRequired[
        typing_extensions.Annotated[bool, FieldMetadata(alias="advancedFigureParsingEnabled")]
    ]
    """
    Whether to enable advanced figure parsing.
    """

    review_agent: typing_extensions.NotRequired[
        typing_extensions.Annotated[
            LegacyExtractionAdvancedOptionsReviewAgentParams, FieldMetadata(alias="reviewAgent")
        ]
    ]
    """
    Configuration for the review agent that analyzes extraction results.
    When enabled, each field in the output metadata will include a `reviewAgentScore` (1-5)
    and may include additional `insights` of type `issue` or `review_summary` to help identify
    fields that may need manual review.
    
    To learn more, view the [Review Agent Documentation](https://docs.extend.ai/product/extraction/review-agent)
    """

    array_strategy: typing_extensions.NotRequired[
        typing_extensions.Annotated[ArrayStrategyParams, FieldMetadata(alias="arrayStrategy")]
    ]
    """
    Strategy for handling large arrays in documents.
    """

    chunking_options: typing_extensions.NotRequired[
        typing_extensions.Annotated[LegacyExtractChunkingOptionsParams, FieldMetadata(alias="chunkingOptions")]
    ]
    excel_sheet_ranges: typing_extensions.NotRequired[
        typing_extensions.Annotated[typing.Sequence[ExcelSheetRangeParams], FieldMetadata(alias="excelSheetRanges")]
    ]
    """
    Ranges of sheet indices to extract from Excel documents.
    """

    excel_sheet_selection_strategy: typing_extensions.NotRequired[
        typing_extensions.Annotated[
            LegacyExtractionAdvancedOptionsExcelSheetSelectionStrategy,
            FieldMetadata(alias="excelSheetSelectionStrategy"),
        ]
    ]
    """
    Strategy for selecting sheets from Excel documents.
    """

    fixed_page_limit: typing_extensions.NotRequired[
        typing_extensions.Annotated[int, FieldMetadata(alias="fixedPageLimit")]
    ]
    """
    DEPRECATED - See [Page Ranges](/product/page-ranges).
    """

    page_ranges: typing_extensions.NotRequired[
        typing_extensions.Annotated[PageRangesParams, FieldMetadata(alias="pageRanges")]
    ]
