fix: 代码整合修复 - Entity类型、题库生成、评估流程等14项修复

This commit is contained in:
Developer
2026-05-14 09:55:07 +08:00
parent 122ab5e96f
commit 368eddfd75
17 changed files with 1666 additions and 115 deletions
+4 -3
View File
@@ -11,9 +11,10 @@ import { reportAnalyzerNode } from './nodes/analyzer.node';
const routeAfterGrading = (state: typeof EvaluationAnnotation.State) => {
const targetCount = state.questionCount || 5;
const questionsLen = state.questions?.length || 0;
const currentIndex = Math.max(0, state.currentQuestionIndex || 0);
console.log('[Router] Evaluation Result:', {
currentIndex: state.currentQuestionIndex,
currentIndex,
shouldFollowUp: state.shouldFollowUp,
numQuestions: questionsLen,
targetCount,
@@ -24,9 +25,9 @@ const routeAfterGrading = (state: typeof EvaluationAnnotation.State) => {
return 'interviewer';
}
if (state.currentQuestionIndex < targetCount) {
if (currentIndex < targetCount) {
// If the next question isn't generated yet, go back to generator
if (state.currentQuestionIndex >= questionsLen) {
if (currentIndex >= questionsLen) {
console.log('[Router] Index >= Questions, routing to generator');
return 'generator';
}
@@ -79,6 +79,12 @@ export const questionGeneratorNode = async (
.join('\n');
const existingQuestions = state.questions || [];
if (existingQuestions.length >= limitCount) {
console.log('[GeneratorNode] Skipping generation - enough questions from bank:', existingQuestions.length);
return { questions: existingQuestions };
}
const existingQuestionsText = existingQuestions
.map((q, i) => `Q${i + 1}: ${q.questionText}`)
.join('\n');