feat: LLM-generated adaptive follow-up questions

- Grader: LLM outputs follow_up_question targeting uncovered keyPoints
- Remove static followupHints usage in grading flow
- maxFollowUps sourced from question.maxFollowUps (hints.length)
- Clean answerKey: remove followupHints field
- Three-language prompt update with examples and bad examples
- Grader spec: add follow_up_question to mock responses
This commit is contained in:
Developer
2026-05-21 14:18:14 +08:00
parent 7fd2a4cda2
commit 02f4ab23f7
3 changed files with 48 additions and 29 deletions
+3 -3
View File
@@ -532,16 +532,16 @@ private async getModel(tenantId: string): Promise<ChatOpenAI> {
difficulty: item.difficulty,
dimension: item.dimension,
basis: item.basis,
maxFollowUps: item.followupHints?.length || 0,
};
});
const answerKey: Record<string, { correctAnswer?: string | null; judgment?: string | null; followupHints?: string[] | null }> = {};
const answerKey: Record<string, { correctAnswer?: string | null; judgment?: string | null }> = {};
selectedItems.forEach(item => {
if (item.correctAnswer || item.judgment || item.followupHints) {
if (item.correctAnswer || item.judgment) {
answerKey[item.id] = {
correctAnswer: item.correctAnswer,
judgment: item.judgment,
followupHints: item.followupHints,
};
}
});