Update app.py
Browse files
app.py
CHANGED
|
@@ -142,20 +142,18 @@ openai.api_key = st.secrets["OPENAI_API_KEY"]
|
|
| 142 |
|
| 143 |
def generate_question(role, topic, difficulty_level):
|
| 144 |
prompt = f"Generate an interview question for the role of {role} on the topic of {topic} with difficulty level {difficulty_level}."
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
return response
|
| 151 |
|
| 152 |
def evaluate_answer(question, user_answer):
|
| 153 |
prompt = f"Question: {question}\nUser's Answer: {user_answer}\nEvaluate the answer and provide feedback. Also, provide the best possible answer."
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
max_tokens=150
|
| 158 |
-
)
|
| 159 |
return response
|
| 160 |
|
| 161 |
st.title("Mock Interview Bot")
|
|
|
|
| 142 |
|
| 143 |
def generate_question(role, topic, difficulty_level):
|
| 144 |
prompt = f"Generate an interview question for the role of {role} on the topic of {topic} with difficulty level {difficulty_level}."
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["OPENAI_API_KEY"])
|
| 148 |
+
response = llm(prompt)
|
| 149 |
+
|
| 150 |
return response
|
| 151 |
|
| 152 |
def evaluate_answer(question, user_answer):
|
| 153 |
prompt = f"Question: {question}\nUser's Answer: {user_answer}\nEvaluate the answer and provide feedback. Also, provide the best possible answer."
|
| 154 |
+
llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["OPENAI_API_KEY"])
|
| 155 |
+
response = llm(prompt)
|
| 156 |
+
|
|
|
|
|
|
|
| 157 |
return response
|
| 158 |
|
| 159 |
st.title("Mock Interview Bot")
|