Spaces:
Runtime error
Runtime error
Greg Thompson
commited on
Commit
•
fd4517a
1
Parent(s):
f37181c
Ensure input_prompt is given
Browse files
mathtext_fastapi/v2_conversation_manager.py
CHANGED
@@ -120,11 +120,12 @@ def retrieve_microlesson_content(context_data, user_message, microlesson, contac
|
|
120 |
'input_prompt': input_prompt,
|
121 |
'state': state_label
|
122 |
}
|
123 |
-
elif context_data['local_state'] =='addition2' or microlesson == 'addition2':
|
124 |
if user_message == 'harder' or user_message == 'easier':
|
125 |
user_message = ''
|
126 |
message_package = num_one.process_user_message(contact_uuid, user_message)
|
127 |
message_package['state'] = 'addition2'
|
|
|
128 |
|
129 |
elif context_data['local_state'] == 'subtraction-question-sequence' or \
|
130 |
user_message == 'subtract' or \
|
@@ -243,8 +244,8 @@ def manage_conversation_response(data_json):
|
|
243 |
for message in microlesson_content['messages']:
|
244 |
data = create_text_message(message, whatsapp_id)
|
245 |
|
246 |
-
print("data")
|
247 |
-
print(data)
|
248 |
|
249 |
r = requests.post(
|
250 |
f'https://whatsapp.turn.io/v1/messages',
|
|
|
120 |
'input_prompt': input_prompt,
|
121 |
'state': state_label
|
122 |
}
|
123 |
+
elif context_data['local_state'] == 'addition2' or microlesson == 'addition2':
|
124 |
if user_message == 'harder' or user_message == 'easier':
|
125 |
user_message = ''
|
126 |
message_package = num_one.process_user_message(contact_uuid, user_message)
|
127 |
message_package['state'] = 'addition2'
|
128 |
+
message_package['input_prompt'] = '?'
|
129 |
|
130 |
elif context_data['local_state'] == 'subtraction-question-sequence' or \
|
131 |
user_message == 'subtract' or \
|
|
|
244 |
for message in microlesson_content['messages']:
|
245 |
data = create_text_message(message, whatsapp_id)
|
246 |
|
247 |
+
# print("data")
|
248 |
+
# print(data)
|
249 |
|
250 |
r = requests.post(
|
251 |
f'https://whatsapp.turn.io/v1/messages',
|