File size: 962 Bytes
f319e82
8db9d92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6cd9fcb
8db9d92
 
 
 
 
 
 
 
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
from llm import ask_llm

INTERVIEW_PROMPT = """
You are a strict technical examiner conducting a student project interview.

You are given:
1. Extracted project content (slides, code snippets, diagrams, UI elements)
2. The student's spoken explanation

Your task:
- Ask ONE clear, specific, technically deep follow-up question.
- Refer to implementation details where possible.
- Avoid generic or vague questions.
- Do NOT provide feedback or explanations.
- Output only the question.
"""

def generate_question(context: str, student_response: str) -> str:
    prompt = f"{INTERVIEW_PROMPT}\n\nProject Content:\n{context}\n\nStudent Response:\n{student_response}\nQuestion:"

    try:
        question = ask_llm(prompt).strip()
        if not question:
            return "Could you explain more about your implementation details?"
        return question
    except Exception:
        return "Could you elaborate further on a technical aspect of your project?"