barbara-multimodal commited on
Commit
658912b
·
1 Parent(s): 3dce584

feat: Enhance user experience with personalized messages

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -72,14 +72,14 @@ def handle_question_change(history, selected_question):
72
 
73
  transition_message = f"Alright, let's move on to the next question:\n\n{selected_question}"
74
 
75
- return [("", transition_message)], gr.update(interactive=True), gr.update(interactive=True)
76
  else:
77
  if selected_question:
78
  last_question = f"Great start! Here's your first question:\n\n{selected_question}"
79
  else:
80
  last_question = selected_question
81
 
82
- new_history = history + [("", last_question)]
83
 
84
  return [entry for entry in new_history if entry[1] is not None], gr.update(interactive=True), gr.update(interactive=True)
85
 
@@ -90,7 +90,10 @@ def reset_interface(conversation_mode):
90
  if conversation_mode == "Interviewer":
91
  chatbot_label = "Multimodal Interviewer Agent"
92
  session_id = random.randint(3000, 20000)
93
- greeting_message = (
 
 
 
94
  "Hello, and welcome to your interview for the Senior Product Manager position at InnovateTech Solutions!\n\n"
95
  "I'll be guiding you through a series of questions to understand your experience and qualifications.\n\n"
96
  "Take your time with the responses. When you're ready, select a question from the list above to begin."
@@ -98,7 +101,10 @@ def reset_interface(conversation_mode):
98
  else:
99
  chatbot_label = "Multimodal Coach Agent"
100
  session_id = random.randint(3000, 20000)
101
- greeting_message = (
 
 
 
102
  "Hi!\n\n"
103
  "Welcome to your interview preparation session for the Senior Product Manager role at InnovateTech Solutions.\n\n"
104
  "I'm here to help you refine your responses and feel confident for your upcoming interview.\n\n"
@@ -106,7 +112,7 @@ def reset_interface(conversation_mode):
106
  )
107
 
108
  return (
109
- gr.update(value=[("", greeting_message)], label=chatbot_label),
110
  gr.update(choices=full_questions, value=None, label="Choose an interview question (Required)", interactive=True),
111
  "",
112
  gr.update(value="Send", interactive=False)
 
72
 
73
  transition_message = f"Alright, let's move on to the next question:\n\n{selected_question}"
74
 
75
+ return [("I'm ready for the next question now.", transition_message)], gr.update(interactive=True), gr.update(interactive=True)
76
  else:
77
  if selected_question:
78
  last_question = f"Great start! Here's your first question:\n\n{selected_question}"
79
  else:
80
  last_question = selected_question
81
 
82
+ new_history = history + [("One moment...", last_question)]
83
 
84
  return [entry for entry in new_history if entry[1] is not None], gr.update(interactive=True), gr.update(interactive=True)
85
 
 
90
  if conversation_mode == "Interviewer":
91
  chatbot_label = "Multimodal Interviewer Agent"
92
  session_id = random.randint(3000, 20000)
93
+
94
+ user_greeting_message = "I've selected Interviewer mode, and I'm ready to begin."
95
+
96
+ chatbot_greeting_message = (
97
  "Hello, and welcome to your interview for the Senior Product Manager position at InnovateTech Solutions!\n\n"
98
  "I'll be guiding you through a series of questions to understand your experience and qualifications.\n\n"
99
  "Take your time with the responses. When you're ready, select a question from the list above to begin."
 
101
  else:
102
  chatbot_label = "Multimodal Coach Agent"
103
  session_id = random.randint(3000, 20000)
104
+
105
+ user_greeting_message = "Hey there! I've selected Coach mode. Let's dive in."
106
+
107
+ chatbot_greeting_message = (
108
  "Hi!\n\n"
109
  "Welcome to your interview preparation session for the Senior Product Manager role at InnovateTech Solutions.\n\n"
110
  "I'm here to help you refine your responses and feel confident for your upcoming interview.\n\n"
 
112
  )
113
 
114
  return (
115
+ gr.update(value=[(user_greeting_message, chatbot_greeting_message)], label=chatbot_label),
116
  gr.update(choices=full_questions, value=None, label="Choose an interview question (Required)", interactive=True),
117
  "",
118
  gr.update(value="Send", interactive=False)