# 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 .pydantic_pronunciation_dictionary_version_locator import PydanticPronunciationDictionaryVersionLocator
from .suggested_audio_tag import SuggestedAudioTag
from .supported_voice import SupportedVoice
from .text_normalisation_type import TextNormalisationType
from .tts_conversational_model import TtsConversationalModel
from .tts_optimize_streaming_latency import TtsOptimizeStreamingLatency
from .tts_output_format import TtsOutputFormat


class TtsConversationalConfigWorkflowOverrideInput(UncheckedBaseModel):
    model_id: typing.Optional[TtsConversationalModel] = pydantic.Field(default=None)
    """
    The model to use for TTS
    """

    voice_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The voice ID to use for TTS
    """

    supported_voices: typing.Optional[typing.List[SupportedVoice]] = pydantic.Field(default=None)
    """
    Additional supported voices for the agent
    """

    expressive_mode: typing.Optional[bool] = pydantic.Field(default=None)
    """
    When enabled, applies expressive audio tags prompt. Automatically disabled for non-v3 models.
    """

    suggested_audio_tags: typing.Optional[typing.List[SuggestedAudioTag]] = pydantic.Field(default=None)
    """
    Suggested audio tags to boost expressive speech (for eleven_v3 and eleven_v3_conversational models). The agent can still use other tags not listed here.
    """

    agent_output_audio_format: typing.Optional[TtsOutputFormat] = pydantic.Field(default=None)
    """
    The audio format to use for TTS
    """

    optimize_streaming_latency: typing.Optional[TtsOptimizeStreamingLatency] = pydantic.Field(default=None)
    """
    Deprecated: this field is a no-op and is ignored.
    """

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

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

    similarity_boost: typing.Optional[float] = pydantic.Field(default=None)
    """
    The similarity boost for generated speech
    """

    text_normalisation_type: typing.Optional[TextNormalisationType] = pydantic.Field(default=None)
    """
    Method for converting numbers to words before converting text to speech. If set to SYSTEM_PROMPT, the system prompt will be updated to include normalization instructions. If set to ELEVENLABS, the text will be normalized after generation, incurring slight additional latency.
    """

    pronunciation_dictionary_locators: typing.Optional[typing.List[PydanticPronunciationDictionaryVersionLocator]] = (
        pydantic.Field(default=None)
    )
    """
    The pronunciation dictionary locators
    """

    enable_phoneme_tags: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Opt-in to SSML phoneme tag handling for V3 models. When enabled, phoneme tags (inline and from pronunciation dictionaries) are parsed into inline IPA before being sent to the model.
    """

    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
