# 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 .extract_chunking_options import ExtractChunkingOptions
from .page_ranges import PageRanges


class ExtractionAdvancedOptions(UncheckedBaseModel):
    document_kind: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="documentKind")] = (
        pydantic.Field(default=None)
    )
    """
    The kind of document being processed.
    """

    key_definitions: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="keyDefinitions")] = (
        pydantic.Field(default=None)
    )
    """
    Custom key definitions for extraction.
    """

    model_reasoning_insights_enabled: typing_extensions.Annotated[
        typing.Optional[bool], FieldMetadata(alias="modelReasoningInsightsEnabled")
    ] = pydantic.Field(default=None)
    """
    Whether to enable model reasoning insights.
    """

    advanced_multimodal_enabled: typing_extensions.Annotated[
        typing.Optional[bool], FieldMetadata(alias="advancedMultimodalEnabled")
    ] = pydantic.Field(default=None)
    """
    Whether to enable advanced multimodal features.
    """

    citations_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="citationsEnabled")] = (
        pydantic.Field(default=None)
    )
    """
    Whether to enable citations in the output.
    """

    advanced_figure_parsing_enabled: typing_extensions.Annotated[
        typing.Optional[bool], FieldMetadata(alias="advancedFigureParsingEnabled")
    ] = pydantic.Field(default=None)
    """
    Whether to enable advanced figure parsing.
    """

    chunking_options: typing_extensions.Annotated[
        typing.Optional[ExtractChunkingOptions], FieldMetadata(alias="chunkingOptions")
    ] = None
    fixed_page_limit: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="fixedPageLimit")] = (
        pydantic.Field(default=None)
    )
    """
    Optional fixed limit on the number of pages to process. See [Page Ranges](/product/page-ranges).
    """

    page_ranges: typing_extensions.Annotated[typing.Optional[PageRanges], FieldMetadata(alias="pageRanges")] = None

    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
