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

from __future__ import annotations
from ..core.pydantic_utilities import UniversalBaseModel
from .metadata_filters import MetadataFilters
import typing
from .pipeline_create_embedding_config import PipelineCreateEmbeddingConfig
from .pipeline_create_transform_config import PipelineCreateTransformConfig
import pydantic
from .configured_transformation_item import ConfiguredTransformationItem
from .data_sink_create import DataSinkCreate
from .preset_retrieval_params import PresetRetrievalParams
from .eval_execution_params import EvalExecutionParams
from .llama_parse_parameters import LlamaParseParameters
from .pipeline_type import PipelineType
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.pydantic_utilities import update_forward_refs


class PipelineCreate(UniversalBaseModel):
    """
    Schema for creating a pipeline.
    """

    embedding_config: typing.Optional[PipelineCreateEmbeddingConfig] = None
    transform_config: typing.Optional[PipelineCreateTransformConfig] = pydantic.Field(default=None)
    """
    Configuration for the transformation.
    """

    configured_transformations: typing.Optional[typing.List[ConfiguredTransformationItem]] = pydantic.Field(
        default=None
    )
    """
    Deprecated, use embedding_config or transform_config instead. configured transformations for the pipeline.
    """

    data_sink_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Data sink ID. When provided instead of data_sink, the data sink will be looked up by ID.
    """

    embedding_model_config_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Embedding model config ID. When provided instead of embedding_config, the embedding model config will be looked up by ID.
    """

    data_sink: typing.Optional[DataSinkCreate] = pydantic.Field(default=None)
    """
    Data sink. When provided instead of data_sink_id, the data sink will be created.
    """

    preset_retrieval_parameters: typing.Optional[PresetRetrievalParams] = pydantic.Field(default=None)
    """
    Preset retrieval parameters for the pipeline.
    """

    eval_parameters: typing.Optional[EvalExecutionParams] = pydantic.Field(default=None)
    """
    Eval parameters for the pipeline.
    """

    llama_parse_parameters: typing.Optional[LlamaParseParameters] = pydantic.Field(default=None)
    """
    Settings that can be configured for how to use LlamaParse to parse files within a LlamaCloud pipeline.
    """

    name: str
    pipeline_type: typing.Optional[PipelineType] = pydantic.Field(default=None)
    """
    Type of pipeline. Either PLAYGROUND or MANAGED.
    """

    managed_pipeline_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the ManagedPipeline this playground pipeline is linked to.
    """

    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


update_forward_refs(MetadataFilters, PipelineCreate=PipelineCreate)
