Spaces:
Running
Running
Upload schema_script.py
Browse files- schema_script.py +31 -0
schema_script.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import List
|
| 2 |
+
from pydantic import BaseModel, ConfigDict, constr
|
| 3 |
+
|
| 4 |
+
Timestamp = constr(pattern=r'^\d{1,2}:\d{2}$')
|
| 5 |
+
RangeTimestamp = constr(pattern=r'^\d{1,2}:\d{2}-\d{1,2}:\d{2}$')
|
| 6 |
+
Score010 = constr(pattern=r'^(?:[0-9]|10)/10$')
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
class ScriptTable(BaseModel):
|
| 10 |
+
timestamp: Timestamp
|
| 11 |
+
script_voiceover: str
|
| 12 |
+
visual_direction: str
|
| 13 |
+
psychological_trigger: str
|
| 14 |
+
cta_action: str
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
class ScriptVariations(BaseModel):
|
| 18 |
+
variation_name: str
|
| 19 |
+
script_table: List[ScriptTable]
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class ScriptResponse(BaseModel):
|
| 23 |
+
# Accept & ignore any extra fields the model might emit
|
| 24 |
+
model_config = ConfigDict(extra="ignore")
|
| 25 |
+
script_variations: List[ScriptVariations]
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
|