Spaces:
Sleeping
Sleeping
File size: 2,348 Bytes
cd8c2bb |
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
from typing import List, Dict, Any
from pydantic import BaseModel, Field, confloat, conlist, RootModel
class ItemExplanationInput(BaseModel):
question: str
user_answer: str
solution: str
class ItemExplanationOutput(BaseModel):
hint: str
guided: str
full: str
class MasteryDiagEvent(BaseModel):
correct: bool
rt: int
hints: int
class MasteryDiagnosticInput(BaseModel):
skill: str
history: conlist(MasteryDiagEvent, min_length=1, max_length=50)
class MasteryDiagnosticOutput(BaseModel):
mastery: confloat(ge=0.0, le=1.0)
comment: str
class NextItemCandidate(BaseModel):
item_id: str
skill: str
p_correct: confloat(ge=0.0, le=1.0)
due: bool
class NextItemSelectorInput(BaseModel):
user_id: str
candidates: conlist(NextItemCandidate, min_length=1)
class NextItemSelectorOutput(BaseModel):
item_id: str
reason: str
class SkillMastery(BaseModel):
name: str
mastery: confloat(ge=0.0, le=1.0)
class SkillFeedbackInput(BaseModel):
skills: conlist(SkillMastery, min_length=1)
class SkillWeakness(BaseModel):
skill: str
tip: str
class SkillFeedbackOutput(BaseModel):
strengths: List[str]
weaknesses: List[SkillWeakness]
class HintGenerationInput(BaseModel):
question: str
class HintGenerationOutput(BaseModel):
field_1: str = Field(alias='1')
field_2: str = Field(alias='2')
field_3: str = Field(alias='3')
class Config:
populate_by_name = True
class ReflectionInput(BaseModel):
session: Dict[str, Any]
class ReflectionOutput(BaseModel):
reflection: str
improvement: str
class InstructorItem(BaseModel):
id: str
discrimination: float
accuracy: confloat(ge=0.0, le=1.0)
class InstructorInsightInput(BaseModel):
items: conlist(InstructorItem, min_length=1)
class InstructorInsightRow(BaseModel):
item_id: str
flag: str
class ExplanationCompressionInput(BaseModel):
explanation: str
class ExplanationCompressionOutput(BaseModel):
recap: str
class QuestionAuthoringInput(BaseModel):
skill: str
difficulty: str
class QAItem(BaseModel):
q: str
a: str
why: str
class QuestionAuthoringOutput(RootModel[List[QAItem]]):
pass
class ToneNormalizerInput(BaseModel):
raw: str
class ToneNormalizerOutput(BaseModel):
normalized: str
|