| """ | |
| Pydantic schemas for API request/response validation. | |
| """ | |
| from pydantic import BaseModel, Field | |
| from typing import Optional, Dict | |
| class CorrectionRequest(BaseModel): | |
| text: str = Field(..., min_length=10, max_length=5000, description="Raw dyslectic text to correct.") | |
| master_copy: Optional[str] = Field(None, description="Optional master copy to match style toward.") | |
| style_alpha: float = Field(0.6, ge=0.0, le=1.0, description="Weight given to user's own style (0=full master, 1=full user).") | |
| class CorrectionResponse(BaseModel): | |
| original: str | |
| corrected: str | |
| style_similarity: float | |
| awl_coverage: float | |
| readability: Dict[str, float] | |
| changes_summary: str | |