mirror of
https://github.com/remsky/Kokoro-FastAPI.git
synced 2025-08-05 16:48:53 +00:00
22 lines
493 B
Python
22 lines
493 B
Python
![]() |
from pydantic import BaseModel
|
||
|
|
||
|
from typing import Optional
|
||
|
|
||
|
|
||
|
class TTSRequest(BaseModel):
|
||
|
text: str
|
||
|
voice: str = "af" # Default voice
|
||
|
local: bool = False # Whether to save file locally or return bytes
|
||
|
|
||
|
|
||
|
class TTSResponse(BaseModel):
|
||
|
request_id: int
|
||
|
status: str
|
||
|
output_file: Optional[str] = None # Path for local file
|
||
|
processing_time: Optional[float] = None # Processing time in seconds
|
||
|
|
||
|
|
||
|
class VoicesResponse(BaseModel):
|
||
|
voices: list[str]
|
||
|
default: str
|