Spaces:
Running
Running
File size: 385 Bytes
0c527d5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
from enum import Enum
from pydantic import BaseModel
# --- Pydantic Models for Request/Response ---
class Gender(str, Enum):
female = "female"
male = "male"
def __str__(self) -> str:
return self.value
class TTSRequest(BaseModel):
text: str
gender: Gender # Using the Enum here will auto-validate the input
class STTResponse(BaseModel):
text: str |