完善训练链路接口与PDF下载

This commit is contained in:
刘金宝
2026-06-08 15:16:07 +08:00
parent 41a2851120
commit 11b1712b01
12 changed files with 550 additions and 164 deletions
+12 -5
View File
@@ -1,5 +1,12 @@
from typing import Literal
from pydantic import BaseModel
VisitEnvironment = Literal["outpatient", "emergency", "ward"]
AgeGroup = Literal["child", "youth", "middle_aged", "elderly"]
EducationLevel = Literal["primary_or_below", "secondary", "higher"]
Personality = Literal["calm", "anxious", "impatient", "cooperative", "suspicious"]
class ConfigOption(BaseModel):
"""训练配置选项:用于前端渲染单个可选项。"""
@@ -12,14 +19,14 @@ class ConfigOption(BaseModel):
class PatientConfig(BaseModel):
"""病人初始化配置:控制 AI 病人的就诊场景、年龄段、文化程度和性格。"""
visit_environment: str = "outpatient"
age_group: str = "youth"
education_level: str = "higher"
personality: str = "calm"
visit_environment: VisitEnvironment = "outpatient"
age_group: AgeGroup = "youth"
education_level: EducationLevel = "higher"
personality: Personality = "calm"
class TrainingConfigOptionsResponse(BaseModel):
"""训练配置响应:返回默认配置和全部可选项。"""
"""训练配置响应:返回推荐配置和全部可选项。"""
case_id: int
recommended: PatientConfig