Spaces:
Sleeping
Sleeping
| from pydantic import BaseModel | |
| class VerifyRequest(BaseModel): | |
| text: str | |
| class Citation(BaseModel): | |
| title: str = "" | |
| url: str = "" | |
| class JurorVerdictDetail(BaseModel): | |
| juror_id: str | |
| verdict: str | |
| confidence: float = 0.0 | |
| reasoning: str = "" | |
| citations: list[Citation] = [] | |
| class DebateLogEntry(BaseModel): | |
| juror_id: str | |
| original_verdict: str | |
| original_confidence: float = 0.0 | |
| revised_verdict: str | |
| revised_confidence: float = 0.0 | |
| changed: bool = False | |
| class ClaimDetail(BaseModel): | |
| """Per-claim breakdown returned inside the claims[] array.""" | |
| claim: str # clean claim text (no [Ψ³ΩΨ§Ω:] tag) | |
| # SUPPORTED | REFUTED | PARTIALLY_TRUE | UNVERIFIABLE | |
| verdict: str | |
| confidence: float = 0.0 # 0.0 β 1.0 | |
| explanation: str = "" # Arabic paragraph from Explainer | |
| # sources used for this specific claim | |
| citations: list[Citation] = [] | |
| # ββ Jury metadata ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| needs_human_review: bool = False # True when verdict == UNVERIFIABLE | |
| # post-debate per-juror results | |
| jury_outputs: list[JurorVerdictDetail] = [] | |
| debate_log: list[DebateLogEntry] = [] # empty when debate was skipped | |
| class VerifyResponse(BaseModel): | |
| """ | |
| Top-level response from POST /verify. | |
| Article-level fields summarise the full text. | |
| claims[] gives the per-claim breakdown for frontend rendering. | |
| """ | |
| # ββ Article-level summary βββββββββββββββββββββββββββββββββββββββββββββββββ | |
| verdict: str # overall article verdict | |
| confidence: float = 0.0 # average confidence across all claims | |
| arabic_explanation: str # combined Arabic summary paragraph | |
| # deduplicated citations across all claims | |
| citations: list[Citation] = [] | |
| needs_human_review: bool = False # True if any claim is UNVERIFIABLE | |
| # ββ Per-claim breakdown βββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| claims: list[ClaimDetail] = [] | |