Update app.py
Browse files
app.py
CHANGED
@@ -44,25 +44,29 @@ def gpt_call(history, user_message,
|
|
44 |
|
45 |
response = completion.choices[0].message.content
|
46 |
|
47 |
-
#
|
48 |
-
if
|
49 |
-
response = "Great!
|
50 |
|
51 |
-
#
|
|
|
|
|
|
|
|
|
52 |
if "pose a problem" in user_message.lower():
|
53 |
-
response += "\n\nNow that you've explored this concept,
|
54 |
|
55 |
-
#
|
56 |
-
if "
|
57 |
-
response += "\n\
|
58 |
|
59 |
-
#
|
60 |
-
if
|
61 |
-
response
|
62 |
|
63 |
-
# Provide
|
64 |
-
if
|
65 |
-
response += "\n\
|
66 |
|
67 |
return response
|
68 |
|
|
|
44 |
|
45 |
response = completion.choices[0].message.content
|
46 |
|
47 |
+
# Ensure AI is conversational and interactive
|
48 |
+
if any(keyword in user_message.lower() for keyword in ["solve", "explain", "why", "reasoning"]):
|
49 |
+
response = "Great thinking! Now, explain your reasoning step by step. What patterns or relationships do you notice? Let's walk through it together.\n\n" + response
|
50 |
|
51 |
+
# Provide guidance instead of full solutions immediately
|
52 |
+
if any(keyword in user_message.lower() for keyword in ["hint", "stuck", "help"]):
|
53 |
+
response = "Here's a hint: What key properties or relationships can help you solve this? Try breaking it down further.\n\n" + response
|
54 |
+
|
55 |
+
# Encourage problem posing at the end of each module
|
56 |
if "pose a problem" in user_message.lower():
|
57 |
+
response += "\n\nNow that you've explored this concept, can you create your own problem? How would you challenge your students with a similar situation?"
|
58 |
|
59 |
+
# Ask about Common Core practice standards and creativity-directed practices at the end
|
60 |
+
if "summary" in user_message.lower():
|
61 |
+
response += "\n\nReflection time! Which Common Core practice standards did we apply? How did creativity shape your approach to solving this problem?"
|
62 |
|
63 |
+
# Step-by-step solutions instead of immediate answers
|
64 |
+
if any(keyword in user_message.lower() for keyword in ["solution", "answer"]):
|
65 |
+
response = "Let's take this step by step. What information do we have? How can we use it to set up an equation or method?\n\n" + response
|
66 |
|
67 |
+
# Provide illustrations where relevant
|
68 |
+
if any(keyword in user_message.lower() for keyword in ["visualize", "graph", "draw", "picture", "illustration"]):
|
69 |
+
response += "\n\nLet me generate an illustration to help you visualize this concept. It will be an approximation to support your understanding."
|
70 |
|
71 |
return response
|
72 |
|