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

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


class EmbeddingModelConfigUpdateEmbeddingConfig_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 EmbeddingModelConfigUpdateEmbeddingConfig_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 EmbeddingModelConfigUpdateEmbeddingConfig_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 EmbeddingModelConfigUpdateEmbeddingConfig_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 EmbeddingModelConfigUpdateEmbeddingConfig_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 EmbeddingModelConfigUpdateEmbeddingConfig_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 EmbeddingModelConfigUpdateEmbeddingConfig_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


EmbeddingModelConfigUpdateEmbeddingConfig = typing.Union[
    EmbeddingModelConfigUpdateEmbeddingConfig_AzureEmbedding,
    EmbeddingModelConfigUpdateEmbeddingConfig_BedrockEmbedding,
    EmbeddingModelConfigUpdateEmbeddingConfig_CohereEmbedding,
    EmbeddingModelConfigUpdateEmbeddingConfig_GeminiEmbedding,
    EmbeddingModelConfigUpdateEmbeddingConfig_HuggingfaceApiEmbedding,
    EmbeddingModelConfigUpdateEmbeddingConfig_OpenaiEmbedding,
    EmbeddingModelConfigUpdateEmbeddingConfig_VertexaiEmbedding,
]
