Spaces:
Runtime error
Runtime error
Update app.py
Browse files87 unmodified lines8889909192939495969798991001011021031041051061071081091101111121131141151164 unmodified lines12112212312412512612712812913087 unmodified lines return chat_history
# If interview is ongoing # if user_profile.get("questions"): # q_index = user_profile['current_q'] # user_profile['user_answers'].append(message)
# q_index += 1 # user_profile['current_q'] = q_index
# if q_index < len(user_profile['questions']): # bot_msg = f"Next question: {user_profile['questions'][q_index]['question']}" # else: # bot_msg = "Interview complete! Type 'feedback' if you'd like me to analyze your answers." # chat_history.append((message, bot_msg)) # return chat_history if user_profile.get("questions"):
# --- NEW STOP LOGIC --- if message.strip().lower() == 'stop': bot_msg = "Thank you for chatting with Intervu! The interview has been stopped. Type 'feedback' if you'd like me to analyze your answers." chat_history.append((message, bot_msg)) user_profile['questions'] = [] # clear questions list to stop return chat_history
# Existing interview logic continues here: q_index = user_profile['current_q'] user_profile['user_answers'].append(message)
4 unmodified lines bot_msg = f"Next question: {user_profile['questions'][q_index]['question']}" else: bot_msg = "Interview complete! Type 'feedback' if you'd like me to analyze your answers."
chat_history.append((message, bot_msg)) return chat_history
# Handle feedback request if message.strip().lower() == 'feedback':app.py+24