Spaces:
Sleeping
Sleeping
Download models.py from Phoenix1410/LEXGUARD_API: direct link, hf CLI and curl.
- Browser
- Download file 1.68 kB
-
https://huggingface.co/spaces/Phoenix1410/LEXGUARD_API/resolve/main/models.py
- Command line
-
hf download hf://spaces/Phoenix1410/LEXGUARD_API/models.py
-
curl -L -o models.py https://huggingface.co/spaces/Phoenix1410/LEXGUARD_API/resolve/main/models.py
1.68 kB
| 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) |