File size: 1,552 Bytes
c64920d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
MODE_INSTRUCTIONS = {
    "Explain Concept": """
Explain this Python concept for a beginner:

{user_input}

Please include:
- A short explanation
- A simple code example
- A common mistake to avoid
""",
    "Debug Code": """
Help debug this Python code or error message:

{user_input}

Please include:
- What the error probably means
- The corrected code if possible
- A beginner-friendly explanation of the fix
""",
    "Quiz Me": """
Create a short beginner Python quiz about this topic:

{user_input}

Please include:
- 3 multiple-choice questions
- 1 small coding question
- The answers at the end
""",
    "Improve Code": """
Review and improve this Python code:

{user_input}

Please include:
- A cleaner version of the code
- What changed
- One beginner-friendly tip for writing better Python
""",
}


FOLLOW_UP_INSTRUCTION = """
End by asking exactly one short follow-up question that helps the learner continue.
Do not ask multiple questions at once.
"""


QUIZ_INSTRUCTIONS = """
You are running a beginner Python quiz on this topic:

{topic}

The learner answered the previous question with:

{user_answer}

Previous quiz notes:

{quiz_notes}

This is quiz step {quiz_number}.

Please:
- Say whether the learner's answer is correct.
- Explain the answer in 2-4 short sentences.
- If this was question 3, finish with a short score-style summary and recommend the next topic.
- If this was question 1 or 2, ask exactly one new multiple-choice question with A, B, C, and D options.
- Do not reveal the new answer until the learner replies.
"""