from pydantic import BaseModel
from typing import Optional, List


class GenerateAudioRequest(BaseModel):
    text: str
    tts_mode: str = "edgetts"
    voice: str = "zh-CN-YunxiNeural"
    ref_audio_id: Optional[str] = None
    ref_text: Optional[str] = None
    language: str = "zh-CN"
    speed: float = 1.0
    instruct_text: Optional[str] = None


class RenameAudioRequest(BaseModel):
    new_name: str


class GeneratedAudioItem(BaseModel):
    id: str
    name: str
    path: str
    duration_sec: float
    text: str
    tts_mode: str
    language: str
    created_at: int


class GeneratedAudioListResponse(BaseModel):
    items: List[GeneratedAudioItem]
