File size: 624 Bytes
7bb3d15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# app/schemas.py
from __future__ import annotations
from typing import List, Literal
from pydantic import BaseModel, Field, HttpUrl

VerdictLabel = Literal["True", "False", "Misleading", "Unverified"]

class CheckRequest(BaseModel):
    claim: str = Field(..., min_length=8, max_length=1000)

class Source(BaseModel):
    title: str
    url: HttpUrl
    snippet: str | None = None
    evidence: List[str] = Field(default_factory=list)

class CheckResult(BaseModel):
    claim: str
    verdict: VerdictLabel
    confidence: float = Field(ge=0.0, le=1.0)
    rationale: str
    post: str
    sources: List[Source]
    id: str