Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1027,7 +1027,7 @@ def slider_input(chat_history, user_state, attribution_slider, *args, **kwargs):
|
|
| 1027 |
|
| 1028 |
if attribution_slider < 1 or attribution_slider > 10:
|
| 1029 |
response = "Please pick a number between 1 and 10."
|
| 1030 |
-
chat_history[-1] = (attribution_slider, response)
|
| 1031 |
return (
|
| 1032 |
chat_history, # Updated chat history
|
| 1033 |
user_state, # Updated user state
|
|
@@ -1060,7 +1060,7 @@ def slider_input(chat_history, user_state, attribution_slider, *args, **kwargs):
|
|
| 1060 |
"Now, from 1 to 10, which do you think is more likely? (1 = Definitely Option A, 10 = Definitely Option B)\n\n"
|
| 1061 |
f"{user_state['options_text']}"
|
| 1062 |
)
|
| 1063 |
-
chat_history[-1] = (attribution_slider, response)
|
| 1064 |
# Return the chat + user_state, and keep the slider visible
|
| 1065 |
return (
|
| 1066 |
chat_history, # Updated chat history
|
|
@@ -1089,7 +1089,7 @@ def slider_input(chat_history, user_state, attribution_slider, *args, **kwargs):
|
|
| 1089 |
"Next, from 1 to 10, which do you think is more likely? (1 = Definitely Option A, 10 = Definitely Option B)\n\n"
|
| 1090 |
f"{user_state['options_text']}"
|
| 1091 |
)
|
| 1092 |
-
chat_history[-1] = (attribution_slider, response)
|
| 1093 |
return (
|
| 1094 |
chat_history, # Updated chat history
|
| 1095 |
user_state, # Updated user state
|
|
@@ -1123,7 +1123,7 @@ def slider_input(chat_history, user_state, attribution_slider, *args, **kwargs):
|
|
| 1123 |
"On a scale from 1 to 10, which is more likely? (1 = Definitely Option A, 10 = Definitely Option B)\n"
|
| 1124 |
f"{user_state['options_text']}"
|
| 1125 |
)
|
| 1126 |
-
chat_history[-1] = (attribution_slider, response)
|
| 1127 |
return (
|
| 1128 |
chat_history, # Updated chat history
|
| 1129 |
user_state, # Updated user state
|
|
@@ -1190,7 +1190,7 @@ def slider_input(chat_history, user_state, attribution_slider, *args, **kwargs):
|
|
| 1190 |
user_state["stage"] = "usability_feedback"
|
| 1191 |
user_state["usability_question_counter"] = 0
|
| 1192 |
response = "Thank you for completing all the scenarios. We just have a few more questions before you leave.\n \n How easy was it to complete the assessment? (1 = Not at all, 10 = Very much)"
|
| 1193 |
-
chat_history[-1] = (attribution_slider, response)
|
| 1194 |
return (
|
| 1195 |
chat_history, # Updated chat history
|
| 1196 |
user_state, # Updated user state
|
|
@@ -1242,7 +1242,7 @@ def slider_input(chat_history, user_state, attribution_slider, *args, **kwargs):
|
|
| 1242 |
'GAD-7 Score': user_state["gad_score"]
|
| 1243 |
}, user_state)
|
| 1244 |
response = f"Thank you! We are now finished with scene {user_state['vignette_counter'] - 1}. In total you will be seeing 2 scenes.\n\nWhat would you like for your next round?\n1. A situation related to your profession.\n2. A situation related to your personal interests.\n3. Something else about me. (Add another activity or interest that is important to you by saying 'I also like...')"
|
| 1245 |
-
chat_history[-1] = (attribution_slider, response)
|
| 1246 |
return (
|
| 1247 |
chat_history, # Updated chat history
|
| 1248 |
user_state, # Updated user state
|
|
|
|
| 1027 |
|
| 1028 |
if attribution_slider < 1 or attribution_slider > 10:
|
| 1029 |
response = "Please pick a number between 1 and 10."
|
| 1030 |
+
chat_history[-1] = (str(attribution_slider), response)
|
| 1031 |
return (
|
| 1032 |
chat_history, # Updated chat history
|
| 1033 |
user_state, # Updated user state
|
|
|
|
| 1060 |
"Now, from 1 to 10, which do you think is more likely? (1 = Definitely Option A, 10 = Definitely Option B)\n\n"
|
| 1061 |
f"{user_state['options_text']}"
|
| 1062 |
)
|
| 1063 |
+
chat_history[-1] = (str(attribution_slider), response)
|
| 1064 |
# Return the chat + user_state, and keep the slider visible
|
| 1065 |
return (
|
| 1066 |
chat_history, # Updated chat history
|
|
|
|
| 1089 |
"Next, from 1 to 10, which do you think is more likely? (1 = Definitely Option A, 10 = Definitely Option B)\n\n"
|
| 1090 |
f"{user_state['options_text']}"
|
| 1091 |
)
|
| 1092 |
+
chat_history[-1] = (str(attribution_slider), response)
|
| 1093 |
return (
|
| 1094 |
chat_history, # Updated chat history
|
| 1095 |
user_state, # Updated user state
|
|
|
|
| 1123 |
"On a scale from 1 to 10, which is more likely? (1 = Definitely Option A, 10 = Definitely Option B)\n"
|
| 1124 |
f"{user_state['options_text']}"
|
| 1125 |
)
|
| 1126 |
+
chat_history[-1] = (str(attribution_slider), response)
|
| 1127 |
return (
|
| 1128 |
chat_history, # Updated chat history
|
| 1129 |
user_state, # Updated user state
|
|
|
|
| 1190 |
user_state["stage"] = "usability_feedback"
|
| 1191 |
user_state["usability_question_counter"] = 0
|
| 1192 |
response = "Thank you for completing all the scenarios. We just have a few more questions before you leave.\n \n How easy was it to complete the assessment? (1 = Not at all, 10 = Very much)"
|
| 1193 |
+
chat_history[-1] = (str(attribution_slider), response)
|
| 1194 |
return (
|
| 1195 |
chat_history, # Updated chat history
|
| 1196 |
user_state, # Updated user state
|
|
|
|
| 1242 |
'GAD-7 Score': user_state["gad_score"]
|
| 1243 |
}, user_state)
|
| 1244 |
response = f"Thank you! We are now finished with scene {user_state['vignette_counter'] - 1}. In total you will be seeing 2 scenes.\n\nWhat would you like for your next round?\n1. A situation related to your profession.\n2. A situation related to your personal interests.\n3. Something else about me. (Add another activity or interest that is important to you by saying 'I also like...')"
|
| 1245 |
+
chat_history[-1] = (str(attribution_slider), response)
|
| 1246 |
return (
|
| 1247 |
chat_history, # Updated chat history
|
| 1248 |
user_state, # Updated user state
|