Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -352,6 +352,7 @@ def send_whatsapp_message(twilio_client, conversation_sid, message_body, bot_ide
|
|
352 |
.messages \
|
353 |
.create(author=bot_identity_val, body=message_body)
|
354 |
st.success(f"Sent reply to conversation {conversation_sid}")
|
|
|
355 |
return True
|
356 |
except Exception as e:
|
357 |
st.error(f"Error sending Twilio message to {conversation_sid}: {e}")
|
@@ -745,7 +746,7 @@ if st.session_state.get("bot_started") and st.session_state.get("rag_pipeline_re
|
|
745 |
delivery_date=wa_delivery_date,
|
746 |
order_id=wa_order_id,
|
747 |
order_status=wa_order_status
|
748 |
-
)
|
749 |
|
750 |
if send_whatsapp_message(
|
751 |
st.session_state.twilio_client,
|
@@ -772,3 +773,4 @@ if st.session_state.get("app_started"):
|
|
772 |
else:
|
773 |
st.sidebar.warning("App is STOPPED.")
|
774 |
|
|
|
|
352 |
.messages \
|
353 |
.create(author=bot_identity_val, body=message_body)
|
354 |
st.success(f"Sent reply to conversation {conversation_sid}")
|
355 |
+
st.write(f"Twilio response to send: {message_body}")
|
356 |
return True
|
357 |
except Exception as e:
|
358 |
st.error(f"Error sending Twilio message to {conversation_sid}: {e}")
|
|
|
746 |
delivery_date=wa_delivery_date,
|
747 |
order_id=wa_order_id,
|
748 |
order_status=wa_order_status
|
749 |
+
).strip().replace('\n', ' ')
|
750 |
|
751 |
if send_whatsapp_message(
|
752 |
st.session_state.twilio_client,
|
|
|
773 |
else:
|
774 |
st.sidebar.warning("App is STOPPED.")
|
775 |
|
776 |
+
Chatbot is sending multiple messages with twilio. I want same response as per manual query.
|