alibicer commited on
Commit
4d842e1
·
verified ·
1 Parent(s): 2cdba6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -13
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 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
 
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):