"""Schemas — OpenAI GPT-4o Mini TTS (opt-in; interview prompts remain text by default)."""

from typing import Any
from uuid import UUID

from pydantic import BaseModel, Field

from app.schemas.common import StubMeta


class TtsSynthesizeRequest(BaseModel):
    """POST /api/v1/tts/synthesize"""

    correlation_id: UUID | None = None
    interview_id: str | None = None
    text: str = Field(..., min_length=1, max_length=4096)
    voice_id: str | None = Field(
        default=None,
        description="Local voice profile from POST /voice-cloning",
    )
    voice: str | None = Field(
        default=None,
        description="Built-in OpenAI voice name (alloy, coral, …) when no voice_id",
    )
    instructions: str | None = Field(
        default=None,
        description="Speaking style instructions (gpt-4o-mini-tts)",
    )
    response_format: str = Field(default="mp3", description="mp3 | wav | opus | aac | flac")
    language: str | None = None
    options: dict[str, Any] = Field(default_factory=dict)


class TtsSynthesizeResponse(StubMeta):
    correlation_id: UUID | None = None
    interview_id: str | None = None
    model: str | None = None
    voice: str | dict[str, Any] | None = None
    voice_id: str | None = None
    audio_base64: str | None = None
    audio_mime_type: str | None = None
    format: str | None = None
    error_code: str | None = None
