Spaces:
Sleeping
Sleeping
John Landry
commited on
Commit
•
2c84cbb
1
Parent(s):
1887c81
fixit
Browse files
main.py
CHANGED
@@ -37,10 +37,10 @@ async def callback(request: Request):
|
|
37 |
print(body)
|
38 |
data = json.loads(body)
|
39 |
value = data['entry'][0]['changes'][0]['value']
|
40 |
-
message = value['messages'][0]
|
41 |
print("VALUE: " + str(value))
|
42 |
print("MESSAGE:" + str(message))
|
43 |
-
if '
|
|
|
44 |
phone_num = message['from']
|
45 |
mesg_body = value['messages'][0]['text']['body']
|
46 |
documents = vectorstore.similarity_search(mesg_body)
|
|
|
37 |
print(body)
|
38 |
data = json.loads(body)
|
39 |
value = data['entry'][0]['changes'][0]['value']
|
|
|
40 |
print("VALUE: " + str(value))
|
41 |
print("MESSAGE:" + str(message))
|
42 |
+
if 'messages' in value:
|
43 |
+
message = value['messages'][0]
|
44 |
phone_num = message['from']
|
45 |
mesg_body = value['messages'][0]['text']['body']
|
46 |
documents = vectorstore.similarity_search(mesg_body)
|