Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ from openai import OpenAI
|
|
| 5 |
from prompts.initial_prompt import INITIAL_PROMPT
|
| 6 |
from prompts.main_prompt import MAIN_PROMPT
|
| 7 |
|
| 8 |
-
# Load OpenAI API Key
|
| 9 |
if os.path.exists(".env"):
|
| 10 |
load_dotenv(".env")
|
| 11 |
|
|
@@ -42,25 +42,7 @@ def gpt_call(history, user_message,
|
|
| 42 |
top_p=top_p
|
| 43 |
)
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
# Provide step-by-step responses for each section
|
| 48 |
-
if "pre-video" in user_message.lower():
|
| 49 |
-
response = "Great! Before watching the video, solve the problem first. How did you approach solving it?"
|
| 50 |
-
|
| 51 |
-
if "post-video" in user_message.lower():
|
| 52 |
-
response = "Now that you’ve watched the video, let’s start by reflecting on the teacher’s creativity-directed practices. What stood out to you the most?"
|
| 53 |
-
|
| 54 |
-
if "common core" in user_message.lower():
|
| 55 |
-
response = "What Common Core practice standards do you think the teacher emphasized during the lesson? Choose four and explain how you observed these practices in action."
|
| 56 |
-
|
| 57 |
-
if "problem posing" in user_message.lower():
|
| 58 |
-
response = "Based on what you observed, pose a problem that encourages students to use visuals and proportional reasoning. What real-world context will you use?"
|
| 59 |
-
|
| 60 |
-
if "summary" in user_message.lower():
|
| 61 |
-
response = "What’s one change you will make in your own teaching based on this module? Reflect on a specific strategy or approach."
|
| 62 |
-
|
| 63 |
-
return response
|
| 64 |
|
| 65 |
def respond(user_message, history):
|
| 66 |
"""
|
|
|
|
| 5 |
from prompts.initial_prompt import INITIAL_PROMPT
|
| 6 |
from prompts.main_prompt import MAIN_PROMPT
|
| 7 |
|
| 8 |
+
# Load OpenAI API Key
|
| 9 |
if os.path.exists(".env"):
|
| 10 |
load_dotenv(".env")
|
| 11 |
|
|
|
|
| 42 |
top_p=top_p
|
| 43 |
)
|
| 44 |
|
| 45 |
+
return completion.choices[0].message.content
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
def respond(user_message, history):
|
| 48 |
"""
|