Update app.py
Browse files
app.py
CHANGED
@@ -44,26 +44,22 @@ def gpt_call(history, user_message,
|
|
44 |
|
45 |
response = completion.choices[0].message.content
|
46 |
|
47 |
-
# Ensure AI always
|
48 |
-
if any(keyword in user_message.lower() for keyword in ["
|
49 |
-
response = "Before we move
|
50 |
|
51 |
-
#
|
52 |
-
if any(keyword in user_message.lower() for keyword in ["
|
53 |
-
response = "
|
54 |
|
55 |
-
#
|
56 |
-
if any(keyword in user_message.lower() for keyword in ["
|
57 |
-
response = "
|
58 |
|
59 |
-
#
|
60 |
if "pose a problem" in user_message.lower():
|
61 |
-
response += "\n\
|
62 |
-
|
63 |
-
# Ask about Common Core practice standards and creativity-directed practices in the summary
|
64 |
-
if "summary" in user_message.lower():
|
65 |
-
response += "\n\nReflection time! Which Common Core practice standards did we apply? How did creativity shape your approach to solving this problem? What strategies would help students build deeper mathematical reasoning?"
|
66 |
-
|
67 |
return response
|
68 |
|
69 |
def respond(user_message, history):
|
|
|
44 |
|
45 |
response = completion.choices[0].message.content
|
46 |
|
47 |
+
# Ensure AI always asks for reasoning first before answering
|
48 |
+
if any(keyword in user_message.lower() for keyword in ["problem 2", "problem 3"]):
|
49 |
+
response = "Interesting! Before we move on, what do you think about this problem? Is it proportional? Why or why not? Let's explore your reasoning first.\n\n" + response
|
50 |
|
51 |
+
# Push for deeper explanations—even if the answer is correct
|
52 |
+
if any(keyword in user_message.lower() for keyword in ["correct", "right", "exactly"]):
|
53 |
+
response = "That’s a great insight! But let’s push further—can you explain it another way? Could someone misunderstand this concept? Let’s explore that.\n\n" + response
|
54 |
|
55 |
+
# Ensure the AI always asks a follow-up before moving to the next question
|
56 |
+
if any(keyword in user_message.lower() for keyword in ["move on", "next question"]):
|
57 |
+
response = "Before we continue, let’s reflect for a moment—what was the biggest takeaway from this problem? Could we change something and still get a non-proportional relationship?\n\n" + response
|
58 |
|
59 |
+
# Make the Problem-Posing Activity more interactive
|
60 |
if "pose a problem" in user_message.lower():
|
61 |
+
response += "\n\nThat's a great start! But let's refine it—does your problem truly show a non-proportional relationship? What would happen if we removed the fixed cost? Try adjusting it and see if it still works!"
|
62 |
+
|
|
|
|
|
|
|
|
|
63 |
return response
|
64 |
|
65 |
def respond(user_message, history):
|