Spaces:
Sleeping
Sleeping
williamagyapong
commited on
Update main.py
Browse files
main.py
CHANGED
@@ -120,7 +120,6 @@ def process_user_msg(message, mobile):
|
|
120 |
|
121 |
elif intent == 'read':
|
122 |
response = str(read_datalake(mobile, message))
|
123 |
-
print(response)
|
124 |
parsed_trans_data = ""
|
125 |
firestore_msg = response
|
126 |
|
@@ -155,8 +154,10 @@ def hook():
|
|
155 |
# Handle greetings
|
156 |
if message.lower() in ("hi", "hello", "help", "how are you"):
|
157 |
response = "Hi there! My name is SmartLedger. How can I help you today?"
|
|
|
158 |
messenger.send_message(message=f"{response}", recipient_id=mobile)
|
159 |
else:
|
|
|
160 |
firestore_msg1, parsed_trans_data1, response1 = process_user_msg(message, mobile)
|
161 |
|
162 |
messenger.send_message(f"Raw Response: {response1}, \n \n Parsed Response: {parsed_trans_data1}, \n \n Final Response: {firestore_msg1}", recipient_id=mobile)
|
@@ -171,6 +172,7 @@ def hook():
|
|
171 |
print(transcript.text)
|
172 |
message = transcript.text
|
173 |
logging.info(f"\nAudio: {audio}\n")
|
|
|
174 |
firestore_msg1, parsed_trans_data1, response1 = process_user_msg(message, mobile)
|
175 |
messenger.send_message(message=f"Raw Response: {response1}, \n \n Parsed Response: {parsed_trans_data1}, \n \n Final Response: {firestore_msg1}", recipient_id=mobile)
|
176 |
|
|
|
120 |
|
121 |
elif intent == 'read':
|
122 |
response = str(read_datalake(mobile, message))
|
|
|
123 |
parsed_trans_data = ""
|
124 |
firestore_msg = response
|
125 |
|
|
|
154 |
# Handle greetings
|
155 |
if message.lower() in ("hi", "hello", "help", "how are you"):
|
156 |
response = "Hi there! My name is SmartLedger. How can I help you today?"
|
157 |
+
|
158 |
messenger.send_message(message=f"{response}", recipient_id=mobile)
|
159 |
else:
|
160 |
+
messenger_reply_button(mobile, message)
|
161 |
firestore_msg1, parsed_trans_data1, response1 = process_user_msg(message, mobile)
|
162 |
|
163 |
messenger.send_message(f"Raw Response: {response1}, \n \n Parsed Response: {parsed_trans_data1}, \n \n Final Response: {firestore_msg1}", recipient_id=mobile)
|
|
|
172 |
print(transcript.text)
|
173 |
message = transcript.text
|
174 |
logging.info(f"\nAudio: {audio}\n")
|
175 |
+
messenger_reply_button(mobile, message)
|
176 |
firestore_msg1, parsed_trans_data1, response1 = process_user_msg(message, mobile)
|
177 |
messenger.send_message(message=f"Raw Response: {response1}, \n \n Parsed Response: {parsed_trans_data1}, \n \n Final Response: {firestore_msg1}", recipient_id=mobile)
|
178 |
|