John Landry commited on
Commit
2c84cbb
1 Parent(s): 1887c81
Files changed (1) hide show
  1. main.py +2 -2
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 'from' in message:
 
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)