Corin1998 commited on
Commit
6a94de1
·
verified ·
1 Parent(s): 614b01a

Create app/schemas.py

Browse files
Files changed (1) hide show
  1. backend/app/schemas.py +33 -0
backend/app/schemas.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pydantic import BaseModel, Field
2
+ from typing import Optional, Dict, List
3
+
4
+ class GenerateRequest(BaseModel):
5
+ language: str = Field("ja", description="出力言語 'ja' or 'en'")
6
+ industry: str = Field(..., description="相手業界")
7
+ target_company: str = Field(..., description="相手企業名")
8
+ target_persona: str = Field(..., description="担当者ペルソナ(役職など)")
9
+ pain_points: str = Field(..., description="相手課題(箇条書きOK)")
10
+ value_prop: str = Field(..., description="自社の提供価値")
11
+ product_name: str = Field(..., description="製品/サービス名")
12
+ cta: str = Field("15分のオンライン面談をご提案", description="コールトゥアクション")
13
+ tone: str = Field("フォーマルで簡潔", description="希望トーン")
14
+ variables: Dict[str, str] = Field(default_factory=dict, description="差し込み変数 {company, person, ...}")
15
+ length_hint: str = Field("中", description="短/中/長")
16
+ extra_instr: Optional[str] = Field(None, description="追加指示(禁止表現など)")
17
+
18
+ class EmailResponse(BaseModel):
19
+ subject: str
20
+ body: str
21
+ quality: Dict[str, float] # e.g. {"politeness": 0.92, "toxicity": 0.01}
22
+ warnings: List[str] = []
23
+
24
+ class ProposalResponse(BaseModel):
25
+ outline: List[str]
26
+ executive_summary: str
27
+
28
+ class LintRequest(BaseModel):
29
+ text: str
30
+
31
+ class LintResponse(BaseModel):
32
+ issues: List[str]
33
+ toxicity: float