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

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


class MarkdownNodeParser(UniversalBaseModel):
    """
    Markdown node parser.

    Splits a document into Nodes using Markdown header-based splitting logic.
    Each node contains its text content and the path of headers leading to it.

    Args:
        include_metadata (bool): whether to include metadata in nodes
        include_prev_next_rel (bool): whether to include prev/next relationships
    """

    include_metadata: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether or not to consider metadata when splitting.
    """

    include_prev_next_rel: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Include prev/next node relationships.
    """

    callback_manager: typing.Optional[typing.Optional[typing.Any]] = None
    id_func: typing.Optional[str] = pydantic.Field(default=None)
    """
    Function to generate node IDs.
    """

    class_name: typing.Optional[str] = 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
