Update models.py
Browse files
models.py
CHANGED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from pydantic import BaseModel
|
2 |
+
from typing import List, Dict, Optional
|
3 |
+
from enum import Enum
|
4 |
+
|
5 |
+
class ChatRequest(BaseModel):
|
6 |
+
message: str
|
7 |
+
temperature: float = 0.7
|
8 |
+
max_new_tokens: int = 512
|
9 |
+
history: Optional[List[Dict]] = None
|
10 |
+
format: Optional[str] = "clean"
|
11 |
+
|
12 |
+
class VoiceInputRequest(BaseModel):
|
13 |
+
audio_format: str = "wav"
|
14 |
+
language: str = "en-US"
|
15 |
+
|
16 |
+
class VoiceOutputRequest(BaseModel):
|
17 |
+
text: str
|
18 |
+
language: str = "en"
|
19 |
+
slow: bool = False
|
20 |
+
return_format: str = "mp3"
|
21 |
+
|
22 |
+
class RiskLevel(str, Enum):
|
23 |
+
NONE = "none"
|
24 |
+
LOW = "low"
|
25 |
+
MODERATE = "moderate"
|
26 |
+
HIGH = "high"
|
27 |
+
SEVERE = "severe"
|