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

from __future__ import annotations
from ..core.pydantic_utilities import UniversalBaseModel
import typing
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic
from .advanced_mode_transform_config_segmentation_config import AdvancedModeTransformConfigSegmentationConfig
from .advanced_mode_transform_config_chunking_config import AdvancedModeTransformConfigChunkingConfig


class PipelineTransformConfig_Auto(UniversalBaseModel):
    """
    Configuration for the transformation.
    """

    mode: typing.Literal["auto"] = "auto"
    chunk_size: typing.Optional[int] = None
    chunk_overlap: typing.Optional[int] = 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


class PipelineTransformConfig_Advanced(UniversalBaseModel):
    """
    Configuration for the transformation.
    """

    mode: typing.Literal["advanced"] = "advanced"
    segmentation_config: typing.Optional[AdvancedModeTransformConfigSegmentationConfig] = None
    chunking_config: typing.Optional[AdvancedModeTransformConfigChunkingConfig] = 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


PipelineTransformConfig = typing.Union[PipelineTransformConfig_Auto, PipelineTransformConfig_Advanced]
