File size: 481 Bytes
c45f0d6 2da4544 c45f0d6 a71355d c45f0d6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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"
}
} |