File size: 686 Bytes
5a2da96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
35
36


from pydantic import BaseModel
from typing import List, Optional
from pydantic import Field
from typing import Literal


class DetectInput(BaseModel):
    text: str

class SentenceAnalysis(BaseModel):
    sentence: str
    ai_likelihood: float

class DetectResponse(BaseModel):
    overall_ai_score: float  
    flagged_sentences: List[SentenceAnalysis]



class RephraseInput(BaseModel):
    text: str
    tone: Literal["general", "professional", "casual", "polite", "witty"]

class RephraseResponse(BaseModel):
    original_text: str
    rephrased_text: str
    tone_used: str

class GrammarInput(BaseModel):
    text: str

class GrammarResponse(BaseModel):
    corrected_text: str