Greg Thompson commited on
Commit
63d32ce
1 Parent(s): 8d4dd70

Update components related to context

Browse files
app.py CHANGED
@@ -55,9 +55,17 @@ async def programmatic_message_manager(request: Request):
55
  print(request)
56
 
57
  data_dict = await request.json()
 
 
 
58
  message_data = data_dict.get('message_data', '')
59
  context_data = data_dict.get('context', '')
60
 
 
 
 
 
 
61
  context = generate_message(message_data, context_data)
62
  return JSONResponse(context)
63
 
 
55
  print(request)
56
 
57
  data_dict = await request.json()
58
+ print("FULL REQUEST")
59
+ print(data_dict)
60
+
61
  message_data = data_dict.get('message_data', '')
62
  context_data = data_dict.get('context', '')
63
 
64
+ print("MESSAGE_DATA")
65
+ print(message_data)
66
+ print("CONTEXT_DATA")
67
+ print(context_data)
68
+
69
  context = generate_message(message_data, context_data)
70
  return JSONResponse(context)
71
 
mathtext_fastapi/conversation_manager.py CHANGED
@@ -143,6 +143,6 @@ def generate_message(data_json, context_data):
143
  print("==================")
144
 
145
 
146
- context = {"context":{"user":"Alan", "state": "received-and-replied-state"}}
147
 
148
  return context
 
143
  print("==================")
144
 
145
 
146
+ context = {"context":{"user":"524754272", "state": "received-and-replied-state"}}
147
 
148
  return context
scripts/make_request.py CHANGED
@@ -133,7 +133,7 @@ import requests
133
  # print(request)
134
 
135
 
136
- json = b'{"message_data": {"message":{"_vnd":{"v1":{"author":{"id":57787919091,"name":"GT","type":"OWNER"},"card_uuid":null,"chat":{"assigned_to":{"id":"jhk151kl-hj42-3752-3hjk-h4jk6hjkk2","name":"Greg Thompson","type":"OPERATOR"},"contact_uuid":"j43hk26-2hjl-43jk-hnk2-k4ljl46j0ds09","inserted_at":"2022-07-05T04:00:34.033522Z","owner":"+57787919091","permalink":"https://app.turn.io/c/4kl209sd0-a7b8-2hj3-8563-3hu4a89b32","state":"OPEN","state_reason":"Re-opened by inbound message.","unread_count":14,"updated_at":"2023-01-10T02:37:28.487319Z","uuid":"4kl209sd0-a7b8-2hj3-8563-3hu4a89b32"},"direction":"inbound","faq_uuid":null,"in_reply_to":null,"inserted_at":"2023-01-10T02:37:28.477940Z","labels":[{"confidence":0.506479332,"metadata":{"nlu":{"confidence":0.506479332,"intent":"question","model_name":"nlu-general-spacy-ngrams-20191014"}},"uuid":"ha7890s2k-hjk2-2476-s8d9-fh9779a8a9ds","value":"Unclassified"}],"last_status":null,"last_status_timestamp":null,"on_fallback_channel":false,"rendered_content":null,"uuid":"s8df79zhws-h89s-hj23-7s8d-thb248d9bh2qn"}},"from":57787919091,"id":"hsjkthzZGehkzs09sijWA3","text":{"body":"Today is a wonderful day"},"timestamp":1673318248,"type":"text"},"type":"message"}}\n'
137
 
138
 
139
 
 
133
  # print(request)
134
 
135
 
136
+ json = b'{"context": "hi", "message_data": {"message":{"_vnd":{"v1":{"author":{"id":57787919091,"name":"GT","type":"OWNER"},"card_uuid":null,"chat":{"assigned_to":{"id":"jhk151kl-hj42-3752-3hjk-h4jk6hjkk2","name":"Greg Thompson","type":"OPERATOR"},"contact_uuid":"j43hk26-2hjl-43jk-hnk2-k4ljl46j0ds09","inserted_at":"2022-07-05T04:00:34.033522Z","owner":"+57787919091","permalink":"https://app.turn.io/c/4kl209sd0-a7b8-2hj3-8563-3hu4a89b32","state":"OPEN","state_reason":"Re-opened by inbound message.","unread_count":14,"updated_at":"2023-01-10T02:37:28.487319Z","uuid":"4kl209sd0-a7b8-2hj3-8563-3hu4a89b32"},"direction":"inbound","faq_uuid":null,"in_reply_to":null,"inserted_at":"2023-01-10T02:37:28.477940Z","labels":[{"confidence":0.506479332,"metadata":{"nlu":{"confidence":0.506479332,"intent":"question","model_name":"nlu-general-spacy-ngrams-20191014"}},"uuid":"ha7890s2k-hjk2-2476-s8d9-fh9779a8a9ds","value":"Unclassified"}],"last_status":null,"last_status_timestamp":null,"on_fallback_channel":false,"rendered_content":null,"uuid":"s8df79zhws-h89s-hj23-7s8d-thb248d9bh2qn"}},"from":57787919091,"id":"hsjkthzZGehkzs09sijWA3","text":{"body":"Today is a wonderful day"},"timestamp":1673318248,"type":"text"},"type":"message"}}\n'
137
 
138
 
139