Spaces:
Sleeping
Sleeping
williamagyapong
commited on
Update main.py
Browse files
main.py
CHANGED
@@ -115,10 +115,13 @@ def process_user_msg(message, mobile):
|
|
115 |
messenger.send_message(f"*Raw Response*:\n {response}, \n \n *Parsed Response*:\n {parsed_trans_data}, \n \n *Final Response*:\n {response2}", recipient_id=mobile)
|
116 |
else:
|
117 |
# Persist transaction data temporarily for Create, Update, or Delete operations
|
118 |
-
persist_temporary_transaction(parsed_trans_data, mobile)
|
119 |
-
|
120 |
-
|
121 |
-
|
|
|
|
|
|
|
122 |
|
123 |
return True
|
124 |
|
|
|
115 |
messenger.send_message(f"*Raw Response*:\n {response}, \n \n *Parsed Response*:\n {parsed_trans_data}, \n \n *Final Response*:\n {response2}", recipient_id=mobile)
|
116 |
else:
|
117 |
# Persist transaction data temporarily for Create, Update, or Delete operations
|
118 |
+
persist = persist_temporary_transaction(parsed_trans_data, mobile)
|
119 |
+
if persist:
|
120 |
+
messenger.send_message(f"{response} \n\n {parsed_trans_data}", mobile)
|
121 |
+
# Give user the chance to confirm/cancel transaction before processing other intents
|
122 |
+
messenger_reply_button(mobile, f"Raw Response: {response}, \n \n Parsed Response: {parsed_trans_data}")
|
123 |
+
else:
|
124 |
+
messenger.send_message("Please try again!", mobile)
|
125 |
|
126 |
return True
|
127 |
|