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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class SynthesizeRequest(UniversalBaseModel):
    """
    Request body for speech synthesis.
    """

    text: str = pydantic.Field()
    """
    Text to synthesize. Supports emotion tags: <laugh>, <chuckle>, <sigh>, <cough>, <sniffle>, <groan>, <yawn>, <gasp>.
    """

    voice: typing.Optional[str] = pydantic.Field(default=None)
    """
    Voice preset (tara, leah, jess, leo, dan, mia, zac, zoe)
    """

    temperature: typing.Optional[float] = pydantic.Field(default=None)
    """
    Sampling temperature. Lower = more deterministic.
    """

    repetition_penalty: typing.Optional[float] = pydantic.Field(default=None)
    """
    Repetition penalty factor
    """

    output_format: typing.Optional[str] = pydantic.Field(default=None)
    """
    Audio output format (wav or mp3)
    """

    model: typing.Optional[str] = pydantic.Field(default=None)
    """
    Model key override. Uses platform default if omitted.
    """

    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
