Spaces:
Runtime error
Runtime error
Update app.py
Browse files87 unmodified lines888990919293944 unmodified lines9910010110210310410510687 unmodified linesreturn chat_history# If interview is ongoingif user_profile.get("questions"):q_index = user_profile['current_q']user_profile['user_answers'].append(message)4 unmodified linesbot_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 requestif message.strip().lower() == 'feedback':87 unmodified lines8889909192939495969798991001011021031041051061071081091101111121131141151164 unmodified lines12112212312412512612712812913087 unmodified linesreturn 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_historyif 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 stopreturn chat_history# Existing interview logic continues here:q_index = user_profile['current_q']user_profile['user_answers'].append(message)4 unmodified linesbot_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 requestif message.strip().lower() == 'feedback':
app.py+24