| from pydantic import BaseModel, Field | |
| class TTSRequest(BaseModel): | |
| text: str = Field(..., min_length=1, max_length=5000) | |
| voice: str = Field(default="Aaliyah-PlayAI") | |
| format: str = Field(default="wav", pattern="^(wav|mp3)$") | |
| class Config: | |
| json_schema_extra = { | |
| "example": { | |
| "text": "Hello, this is a test of text-to-speech.", | |
| "voice": "Aaliyah-PlayAI", | |
| "format": "wav" | |
| } | |
| } |