智教助手平台:完整初始化
- 前端:Vue3 + TS + Element Plus,24 个页面路由(课件/组题/教案/动画/思维导图/作文批改/命题/课堂/资源/社区等) - 后端:FastAPI + SQLAlchemy + SQLite,17 个路由模块,AI 服务层含降级模板 - AI:glm-5.x 推理模型已禁用思维链,确保输出真实内容 - 修复:ai_service 两处请求体注入 enable_thinking/thinking disabled - 测试账号:13900999999 / test1234
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Any
|
||||
|
||||
|
||||
class AIRequest(BaseModel):
|
||||
prompt: str = Field(..., min_length=1, description="AI请求内容")
|
||||
context: dict[str, Any] = Field(default_factory=dict, description="上下文信息")
|
||||
stream: bool = Field(default=False, description="是否流式返回")
|
||||
|
||||
|
||||
class EssayGradeRequest(BaseModel):
|
||||
essay_text: str = Field(..., min_length=10, description="作文文本")
|
||||
grade_level: str = Field(default="初中", description="年级段")
|
||||
essay_type: str = Field(default="记叙文", description="作文类型")
|
||||
total_score: int = Field(default=50, description="满分")
|
||||
|
||||
|
||||
class ExamGenerateRequest(BaseModel):
|
||||
subject: str = Field(..., min_length=1)
|
||||
grade: str = ""
|
||||
knowledge_points: list[str] = []
|
||||
difficulty: str = Field(default="medium", pattern=r"^(easy|medium|hard)$")
|
||||
question_types: list[str] = Field(default=["choice"])
|
||||
count: int = Field(default=10, ge=1, le=50)
|
||||
total_score: int = Field(default=100)
|
||||
|
||||
|
||||
class HtmlExportRequest(BaseModel):
|
||||
title: str = Field(default="教学内容", max_length=200)
|
||||
html: str = Field(..., min_length=1)
|
||||
|
||||
|
||||
class ExamExportRequest(BaseModel):
|
||||
title: str = Field(default="试卷", max_length=200)
|
||||
subject: str = ""
|
||||
grade: str = ""
|
||||
questions: list[dict[str, Any]] = []
|
||||
answers: list[Any] = []
|
||||
Reference in New Issue
Block a user