from pydantic import BaseModel, Field from typing import Dict, List class ModerationRequest(BaseModel): text: str = Field(..., min_length=1, description="The text to be moderated.") class ModerationResponse(BaseModel): is_flagged: bool model_used: str top_category: str identified_meaning: str = Field( default="", description="The core intent or meaning of the original text." ) suggested_alternatives: List[str] = Field( default_factory=list, description="7-8 dynamically reframed alternatives." ) raw_scores: Dict[str, float]