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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class PdfSearchResultMetaSource(UniversalBaseModel):
    """
    The source of a search result from a PDF document.
    """

    document_type: typing.Literal["PDF"] = "PDF"
    start_page_num: typing.Optional[int] = pydantic.Field(default=None)
    """
    The 1-indexed page number where the chunk starts in the document. Only available for supported chunking strategies and document types.
    """

    end_page_num: typing.Optional[int] = pydantic.Field(default=None)
    """
    The 1-indexed page number where the chunk ends in the document. Only available for supported chunking strategies and document types.
    """

    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
