Update app.py
Browse files
app.py
CHANGED
@@ -44,30 +44,26 @@ def gpt_call(history, user_message,
|
|
44 |
|
45 |
response = completion.choices[0].message.content
|
46 |
|
47 |
-
# Ensure AI is
|
48 |
if any(keyword in user_message.lower() for keyword in ["solve", "explain", "why", "reasoning"]):
|
49 |
-
response = "Great thinking!
|
50 |
|
51 |
-
# Provide
|
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
|
54 |
|
55 |
-
# Encourage
|
56 |
if "pose a problem" in user_message.lower():
|
57 |
-
response += "\n\nNow that you've explored this concept,
|
58 |
|
59 |
-
# Ask about Common Core practice standards and creativity-directed practices
|
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
|
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 |
|
73 |
def respond(user_message, history):
|
|
|
44 |
|
45 |
response = completion.choices[0].message.content
|
46 |
|
47 |
+
# Ensure AI is interactive and always asks for reasoning
|
48 |
if any(keyword in user_message.lower() for keyword in ["solve", "explain", "why", "reasoning"]):
|
49 |
+
response = "Great thinking! Before we move forward, can you explain your reasoning step by step? What patterns do you notice? Let's walk through it together.\n\n" + response
|
50 |
|
51 |
+
# Provide step-by-step hints 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. What happens if we adjust one of the variables?\n\n" + response
|
54 |
|
55 |
+
# Encourage teachers to create their own problems at the end
|
56 |
if "pose a problem" in user_message.lower():
|
57 |
+
response += "\n\nNow that you've explored this concept, try creating a problem similar to the ones we discussed. What elements would you include to ensure it is non-proportional?"
|
58 |
|
59 |
+
# Ask about Common Core practice standards and creativity-directed practices in the summary
|
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? What strategies would help students build deeper mathematical reasoning?"
|
62 |
|
63 |
+
# Step-by-step approach for solutions
|
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 |
return response
|
68 |
|
69 |
def respond(user_message, history):
|