Update app.py
Browse files
app.py
CHANGED
|
@@ -15,12 +15,14 @@ def python_tutor(user_input):
|
|
| 15 |
messages=[
|
| 16 |
{
|
| 17 |
"role": "system",
|
| 18 |
-
"content": "You are a Python tutor. Help users understand Python with short examples. Be kind, clear, and only answer Python-related questions.
|
| 19 |
-
|
|
|
|
| 20 |
2. Provide a concise initial answer:
|
| 21 |
- Include a brief explanation.
|
| 22 |
- Provide a straightforward code example.
|
| 23 |
-
|
|
|
|
| 24 |
},
|
| 25 |
{"role": "user", "content": user_input}
|
| 26 |
],
|
|
|
|
| 15 |
messages=[
|
| 16 |
{
|
| 17 |
"role": "system",
|
| 18 |
+
"content": """You are a Python tutor. Help users understand Python with short examples. Be kind, clear, and only answer Python-related questions.
|
| 19 |
+
|
| 20 |
+
1. Confirm if the question is Python-related. If not, politely inform the user and refrain from answering.
|
| 21 |
2. Provide a concise initial answer:
|
| 22 |
- Include a brief explanation.
|
| 23 |
- Provide a straightforward code example.
|
| 24 |
+
3. Keep the quiz simple and give options to choose. If wrong answers are selected, correct them with an explanation.
|
| 25 |
+
"""
|
| 26 |
},
|
| 27 |
{"role": "user", "content": user_input}
|
| 28 |
],
|