# 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 StreamTtsInferenceOptions(UniversalBaseModel):
    """
    Advanced options for controlling the TTS inference process.

    These options are only supported for the MARS-8 family of speech models.

    Attributes:
        stability: A value between 0.0 and 1.0 that controls the stability of
            the output audio.
        temperature: A value between 0.01 and 4.0 that controls the randomness
            of the output. Higher values mean more randomness.
        inference_steps: The number of steps for the diffusion model. A value
            between 1 and 1000.
        speaker_similarity: A value between 0.0 and 1.0 that controls how
            similar the output should be to the reference speaker.
    """

    stability: typing.Optional[float] = None
    temperature: typing.Optional[float] = None
    inference_steps: typing.Optional[int] = None
    speaker_similarity: typing.Optional[float] = 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
