Greg Thompson commited on
Commit
bf0205f
1 Parent(s): cb15a69

Disable logging

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. scripts/make_request.py +9 -0
app.py CHANGED
@@ -101,5 +101,5 @@ async def evaluate_user_message_with_nlu_api(request: Request):
101
  response_object = {'type': 'integer', 'data': student_response_arr[0]}
102
 
103
  # Uncomment to enable logging to Supabase
104
- prepare_message_data_for_logging(message_data)
105
  return JSONResponse(content=response_object)
 
101
  response_object = {'type': 'integer', 'data': student_response_arr[0]}
102
 
103
  # Uncomment to enable logging to Supabase
104
+ # prepare_message_data_for_logging(message_data)
105
  return JSONResponse(content=response_object)
scripts/make_request.py CHANGED
@@ -112,3 +112,12 @@ request = requests.post(url=
112
 
113
  print(request)
114
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  print(request)
114
 
115
+ 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":"I dont know"},"timestamp":1673318248,"type":"text"},"type":"message"}}\n'
116
+
117
+ # "8, 9, 10" > "8,9,10"
118
+ request = requests.post(url=
119
+ 'http://localhost:7860/nlu',
120
+ data=json
121
+ ).json()
122
+
123
+ print(request)