Spaces:
Sleeping
Sleeping
Update models.py
Browse files
models.py
CHANGED
|
@@ -1,9 +1,34 @@
|
|
| 1 |
from pydantic import BaseModel, Field
|
|
|
|
| 2 |
from datetime import datetime
|
| 3 |
-
from typing import Optional
|
| 4 |
|
|
|
|
| 5 |
class UserSync(BaseModel):
|
| 6 |
clerk_id: str
|
| 7 |
-
email: str
|
| 8 |
name: Optional[str] = None
|
| 9 |
-
created_at: datetime =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from pydantic import BaseModel, Field
|
| 2 |
+
from typing import List, Optional
|
| 3 |
from datetime import datetime
|
|
|
|
| 4 |
|
| 5 |
+
# Existing User Sync Model
|
| 6 |
class UserSync(BaseModel):
|
| 7 |
clerk_id: str
|
| 8 |
+
email: Optional[str] = None
|
| 9 |
name: Optional[str] = None
|
| 10 |
+
created_at: Optional[datetime] = None
|
| 11 |
+
|
| 12 |
+
# --- Testimony Validator & Map-Reduce Models ---
|
| 13 |
+
|
| 14 |
+
class TimelineEvent(BaseModel):
|
| 15 |
+
timeframe: str = Field(description="Date, time, or period of the event")
|
| 16 |
+
event_description: str = Field(description="Description of what occurred")
|
| 17 |
+
source_quote: str = Field(description="Direct verbatim quote from the transcript supporting this event")
|
| 18 |
+
|
| 19 |
+
class Timeline(BaseModel):
|
| 20 |
+
party: str = Field(description="Name or role of the party (e.g., Client, Accused)")
|
| 21 |
+
events: List[TimelineEvent] = Field(default_factory=list, description="Chronological list of events")
|
| 22 |
+
|
| 23 |
+
class Discrepancy(BaseModel):
|
| 24 |
+
type: str = Field(description="Classification: 'Direct Conflict' or 'Omission'")
|
| 25 |
+
timeframe: str = Field(description="Timeframe or date when the conflicting event occurred")
|
| 26 |
+
client_version: Optional[str] = Field(default=None, description="Client's statement of the event")
|
| 27 |
+
accused_version: Optional[str] = Field(default=None, description="Accused party's statement of the event")
|
| 28 |
+
analysis: str = Field(description="Detailed forensic reasoning explaining why this is a conflict or omission")
|
| 29 |
+
severity: str = Field(description="Severity impact: 'High', 'Medium', or 'Low'")
|
| 30 |
+
|
| 31 |
+
class ComparativeAnalysisResult(BaseModel):
|
| 32 |
+
client_timeline: Timeline
|
| 33 |
+
accused_timeline: Timeline
|
| 34 |
+
discrepancies: List[Discrepancy] = Field(default_factory=list)
|