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