File size: 416 Bytes
094f1b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from pydantic import BaseModel
from typing import List, Optional

class Error(BaseModel):
    """Model for individual grammar errors."""
    before: str
    after: str
    explanation: str

class Grammar(BaseModel):
    """Model for grammar check results."""
    spelling: List[Error]
    punctuation: List[Error]
    grammar: List[Error]
    file_path: Optional[str] = None
    corrected_text: Optional[str] = None