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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ....core.pydantic_utilities import IS_PYDANTIC_V2
from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
from .agent_v1update_speak_speak_one_item_provider_aws_polly_credentials import (
    AgentV1UpdateSpeakSpeakOneItemProviderAwsPollyCredentials,
)
from .agent_v1update_speak_speak_one_item_provider_aws_polly_engine import (
    AgentV1UpdateSpeakSpeakOneItemProviderAwsPollyEngine,
)
from .agent_v1update_speak_speak_one_item_provider_aws_polly_voice import (
    AgentV1UpdateSpeakSpeakOneItemProviderAwsPollyVoice,
)
from .agent_v1update_speak_speak_one_item_provider_cartesia_model_id import (
    AgentV1UpdateSpeakSpeakOneItemProviderCartesiaModelId,
)
from .agent_v1update_speak_speak_one_item_provider_cartesia_version import (
    AgentV1UpdateSpeakSpeakOneItemProviderCartesiaVersion,
)
from .agent_v1update_speak_speak_one_item_provider_cartesia_voice import (
    AgentV1UpdateSpeakSpeakOneItemProviderCartesiaVoice,
)
from .agent_v1update_speak_speak_one_item_provider_deepgram_model import (
    AgentV1UpdateSpeakSpeakOneItemProviderDeepgramModel,
)
from .agent_v1update_speak_speak_one_item_provider_deepgram_version import (
    AgentV1UpdateSpeakSpeakOneItemProviderDeepgramVersion,
)
from .agent_v1update_speak_speak_one_item_provider_eleven_labs_model_id import (
    AgentV1UpdateSpeakSpeakOneItemProviderElevenLabsModelId,
)
from .agent_v1update_speak_speak_one_item_provider_eleven_labs_version import (
    AgentV1UpdateSpeakSpeakOneItemProviderElevenLabsVersion,
)
from .agent_v1update_speak_speak_one_item_provider_open_ai_model import (
    AgentV1UpdateSpeakSpeakOneItemProviderOpenAiModel,
)
from .agent_v1update_speak_speak_one_item_provider_open_ai_version import (
    AgentV1UpdateSpeakSpeakOneItemProviderOpenAiVersion,
)
from .agent_v1update_speak_speak_one_item_provider_open_ai_voice import (
    AgentV1UpdateSpeakSpeakOneItemProviderOpenAiVoice,
)


class AgentV1UpdateSpeakSpeakOneItemProvider_Deepgram(UncheckedBaseModel):
    type: typing.Literal["deepgram"] = "deepgram"
    version: typing.Optional[AgentV1UpdateSpeakSpeakOneItemProviderDeepgramVersion] = None
    model: AgentV1UpdateSpeakSpeakOneItemProviderDeepgramModel

    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 AgentV1UpdateSpeakSpeakOneItemProvider_ElevenLabs(UncheckedBaseModel):
    type: typing.Literal["eleven_labs"] = "eleven_labs"
    version: typing.Optional[AgentV1UpdateSpeakSpeakOneItemProviderElevenLabsVersion] = None
    model_id: AgentV1UpdateSpeakSpeakOneItemProviderElevenLabsModelId
    language: typing.Optional[str] = None
    language_code: 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


class AgentV1UpdateSpeakSpeakOneItemProvider_Cartesia(UncheckedBaseModel):
    type: typing.Literal["cartesia"] = "cartesia"
    version: typing.Optional[AgentV1UpdateSpeakSpeakOneItemProviderCartesiaVersion] = None
    model_id: AgentV1UpdateSpeakSpeakOneItemProviderCartesiaModelId
    voice: AgentV1UpdateSpeakSpeakOneItemProviderCartesiaVoice
    language: 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


class AgentV1UpdateSpeakSpeakOneItemProvider_OpenAi(UncheckedBaseModel):
    type: typing.Literal["open_ai"] = "open_ai"
    version: typing.Optional[AgentV1UpdateSpeakSpeakOneItemProviderOpenAiVersion] = None
    model: AgentV1UpdateSpeakSpeakOneItemProviderOpenAiModel
    voice: AgentV1UpdateSpeakSpeakOneItemProviderOpenAiVoice

    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 AgentV1UpdateSpeakSpeakOneItemProvider_AwsPolly(UncheckedBaseModel):
    type: typing.Literal["aws_polly"] = "aws_polly"
    voice: AgentV1UpdateSpeakSpeakOneItemProviderAwsPollyVoice
    language: str
    language_code: typing.Optional[str] = None
    engine: AgentV1UpdateSpeakSpeakOneItemProviderAwsPollyEngine
    credentials: AgentV1UpdateSpeakSpeakOneItemProviderAwsPollyCredentials

    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


AgentV1UpdateSpeakSpeakOneItemProvider = typing_extensions.Annotated[
    typing.Union[
        AgentV1UpdateSpeakSpeakOneItemProvider_Deepgram,
        AgentV1UpdateSpeakSpeakOneItemProvider_ElevenLabs,
        AgentV1UpdateSpeakSpeakOneItemProvider_Cartesia,
        AgentV1UpdateSpeakSpeakOneItemProvider_OpenAi,
        AgentV1UpdateSpeakSpeakOneItemProvider_AwsPolly,
    ],
    UnionMetadata(discriminant="type"),
]
