"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from r9s.types import BaseModel
from typing import Literal, Optional
from typing_extensions import NotRequired, TypedDict


AudioSpeechRequestVoice = Literal[
    "alloy",
    "echo",
    "fable",
    "onyx",
    "nova",
    "shimmer",
]
r"""Voice type"""


AudioSpeechRequestResponseFormat = Literal[
    "mp3",
    "opus",
    "aac",
    "flac",
    "wav",
    "pcm",
]


class AudioSpeechRequestTypedDict(TypedDict):
    model: str
    r"""TTS model name"""
    input: str
    r"""Text to convert to speech"""
    voice: AudioSpeechRequestVoice
    r"""Voice type"""
    response_format: NotRequired[AudioSpeechRequestResponseFormat]
    speed: NotRequired[float]
    r"""Speech speed"""


class AudioSpeechRequest(BaseModel):
    model: str
    r"""TTS model name"""

    input: str
    r"""Text to convert to speech"""

    voice: AudioSpeechRequestVoice
    r"""Voice type"""

    response_format: Optional[AudioSpeechRequestResponseFormat] = "mp3"

    speed: Optional[float] = 1
    r"""Speech speed"""
