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

import typing

import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from ...core.unchecked_base_model import UncheckedBaseModel
from .lightning_v31request_language import LightningV31RequestLanguage
from .lightning_v31request_output_format import LightningV31RequestOutputFormat


class LightningV31Request(UncheckedBaseModel):
    text: str = pydantic.Field()
    """
    The text to convert to speech.
    """

    voice_id: str = pydantic.Field()
    """
    The voice identifier to use for speech generation.
    """

    sample_rate: typing.Optional[int] = pydantic.Field(default=None)
    """
    The sample rate for the generated audio.
    """

    speed: typing.Optional[float] = pydantic.Field(default=None)
    """
    The speed of the generated speech.
    """

    language: typing.Optional[LightningV31RequestLanguage] = pydantic.Field(default=None)
    """
    Determines how numbers are spelled out. If set to 'en', numbers will be read in English. If set to 'hi', numbers will be read in Hindi.
    """

    output_format: typing.Optional[LightningV31RequestOutputFormat] = pydantic.Field(default=None)
    """
    The format of the output audio.
    """

    pronunciation_dicts: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    The IDs of the pronunciation dictionaries to use for speech generation.
    """

    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
