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

from __future__ import annotations
from ...core.pydantic_utilities import UniversalBaseModel
import typing
from ...types.azure_open_ai_embedding import AzureOpenAiEmbedding
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic
from ...types.bedrock_embedding import BedrockEmbedding
from ...types.cohere_embedding import CohereEmbedding
from ...types.gemini_embedding import GeminiEmbedding
from ...types.hugging_face_inference_api_embedding import HuggingFaceInferenceApiEmbedding
from ...types.open_ai_embedding import OpenAiEmbedding
from ...types.vertex_text_embedding import VertexTextEmbedding


class PipelineUpdateEmbeddingConfig_AzureEmbedding(UniversalBaseModel):
    type: typing.Literal["AZURE_EMBEDDING"] = "AZURE_EMBEDDING"
    component: typing.Optional[AzureOpenAiEmbedding] = 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 PipelineUpdateEmbeddingConfig_BedrockEmbedding(UniversalBaseModel):
    type: typing.Literal["BEDROCK_EMBEDDING"] = "BEDROCK_EMBEDDING"
    component: typing.Optional[BedrockEmbedding] = 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 PipelineUpdateEmbeddingConfig_CohereEmbedding(UniversalBaseModel):
    type: typing.Literal["COHERE_EMBEDDING"] = "COHERE_EMBEDDING"
    component: typing.Optional[CohereEmbedding] = 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 PipelineUpdateEmbeddingConfig_GeminiEmbedding(UniversalBaseModel):
    type: typing.Literal["GEMINI_EMBEDDING"] = "GEMINI_EMBEDDING"
    component: typing.Optional[GeminiEmbedding] = 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 PipelineUpdateEmbeddingConfig_HuggingfaceApiEmbedding(UniversalBaseModel):
    type: typing.Literal["HUGGINGFACE_API_EMBEDDING"] = "HUGGINGFACE_API_EMBEDDING"
    component: typing.Optional[HuggingFaceInferenceApiEmbedding] = 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 PipelineUpdateEmbeddingConfig_OpenaiEmbedding(UniversalBaseModel):
    type: typing.Literal["OPENAI_EMBEDDING"] = "OPENAI_EMBEDDING"
    component: typing.Optional[OpenAiEmbedding] = 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 PipelineUpdateEmbeddingConfig_VertexaiEmbedding(UniversalBaseModel):
    type: typing.Literal["VERTEXAI_EMBEDDING"] = "VERTEXAI_EMBEDDING"
    component: typing.Optional[VertexTextEmbedding] = 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


PipelineUpdateEmbeddingConfig = typing.Union[
    PipelineUpdateEmbeddingConfig_AzureEmbedding,
    PipelineUpdateEmbeddingConfig_BedrockEmbedding,
    PipelineUpdateEmbeddingConfig_CohereEmbedding,
    PipelineUpdateEmbeddingConfig_GeminiEmbedding,
    PipelineUpdateEmbeddingConfig_HuggingfaceApiEmbedding,
    PipelineUpdateEmbeddingConfig_OpenaiEmbedding,
    PipelineUpdateEmbeddingConfig_VertexaiEmbedding,
]
