alibicer commited on
Commit
2cdba6f
·
verified ·
1 Parent(s): 56b6efb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -14
app.py CHANGED
@@ -44,25 +44,29 @@ def gpt_call(history, user_message,
44
 
45
  response = completion.choices[0].message.content
46
 
47
- # Encourage teachers to explain their reasoning before providing guidance
48
- if "solve" in user_message.lower() or "explain" in user_message.lower():
49
- response = "Great! Before we move forward, can you explain your reasoning? Why do you think this is the right approach? Once you share your thoughts, I'll guide you further.\n\n" + response
50
 
51
- # Encourage problem posing
 
 
 
 
52
  if "pose a problem" in user_message.lower():
53
- response += "\n\nNow that you've explored this concept, try creating your own problem related to it. How would you challenge your students?"
54
 
55
- # Cover Common Core practice standards
56
- if "common core" in user_message.lower():
57
- response += "\n\nHow do you see this aligning with Common Core practice standards? Can you identify any specific standards this connects to?"
58
 
59
- # Encourage creativity-directed practices
60
- if "creativity" in user_message.lower():
61
- response += "\n\nHow did creativity play a role in this problem-solving process? Did you find any opportunities to think differently?"
62
 
63
- # Provide structured summary
64
- if "summary" in user_message.lower():
65
- response += "\n\nSummary: Today, we explored problem-solving strategies, reflected on reasoning, and connected ideas to teaching practices. We examined key characteristics of proportional and non-proportional relationships, explored their graphical representations, and considered pedagogical approaches. Keep thinking about how these concepts can be applied in your own classroom!"
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