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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .cartesia_speak_provider_model_id import CartesiaSpeakProviderModelId
from .cartesia_speak_provider_voice import CartesiaSpeakProviderVoice


class Cartesia(UniversalBaseModel):
    type: typing.Literal["cartesia"] = "cartesia"
    version: typing.Optional[typing.Literal["2025-03-17"]] = pydantic.Field(default=None)
    """
    The API version header for the Cartesia text-to-speech API
    """

    model_id: CartesiaSpeakProviderModelId = pydantic.Field()
    """
    Cartesia model ID
    """

    voice: CartesiaSpeakProviderVoice
    language: typing.Optional[str] = pydantic.Field(default=None)
    """
    Cartesia language code
    """

    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
