from pydantic import BaseModel
from typing import List, Optional

class Detection(BaseModel):
    phrase: str
    start: int
    end: int
    matched_with: str
    confidence: float

class AnalysisResponse(BaseModel):
    file_name: str
    total_phrases_checked: int
    tortured_phrases_found: int
    detections: List[Detection]
    annotated_file_url: Optional[str] = None
