Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -206,7 +206,7 @@ def setup_knowledge_base():
|
|
206 |
|
207 |
# ---------------- Monitor Twilio Conversations ----------------
|
208 |
def start_conversation_monitor(client, index, embed_model, text_chunks):
|
209 |
-
print(f"start_conversation_monitor: {client}")
|
210 |
processed_convos = set()
|
211 |
last_processed_timestamp = {}
|
212 |
|
@@ -230,8 +230,13 @@ def start_conversation_monitor(client, index, embed_model, text_chunks):
|
|
230 |
time.sleep(120)
|
231 |
|
232 |
conversations = client.conversations.v1.conversations.list()
|
233 |
-
|
234 |
for convo in conversations:
|
|
|
|
|
|
|
|
|
|
|
235 |
# Filter out conversations created before app startup
|
236 |
if convo.date_created > APP_START_TIME and convo.sid not in processed_convos:
|
237 |
processed_convos.add(convo.sid)
|
@@ -255,6 +260,6 @@ if __name__ == "__main__":
|
|
255 |
st.error("β Twilio credentials not set.")
|
256 |
else:
|
257 |
client = Client(account_sid, auth_token)
|
258 |
-
print(f"client: {client}")
|
259 |
start_conversation_monitor(client, index, model, chunks)
|
260 |
st.info("β
Bot is now monitoring Twilio conversations.")
|
|
|
206 |
|
207 |
# ---------------- Monitor Twilio Conversations ----------------
|
208 |
def start_conversation_monitor(client, index, embed_model, text_chunks):
|
209 |
+
#print(f"start_conversation_monitor: {client}")
|
210 |
processed_convos = set()
|
211 |
last_processed_timestamp = {}
|
212 |
|
|
|
230 |
time.sleep(120)
|
231 |
|
232 |
conversations = client.conversations.v1.conversations.list()
|
233 |
+
|
234 |
for convo in conversations:
|
235 |
+
print(f"convo.sid: {convo.sid}")
|
236 |
+
print(f"convo.date_created: {convo.date_created}")
|
237 |
+
print(f"APP_START_TIME: {APP_START_TIME}")
|
238 |
+
print(f"processed_convos: {processed_convos}")
|
239 |
+
|
240 |
# Filter out conversations created before app startup
|
241 |
if convo.date_created > APP_START_TIME and convo.sid not in processed_convos:
|
242 |
processed_convos.add(convo.sid)
|
|
|
260 |
st.error("β Twilio credentials not set.")
|
261 |
else:
|
262 |
client = Client(account_sid, auth_token)
|
263 |
+
#print(f"client: {client}")
|
264 |
start_conversation_monitor(client, index, model, chunks)
|
265 |
st.info("β
Bot is now monitoring Twilio conversations.")
|