Greg Thompson commited on
Commit
da5f9ac
1 Parent(s): 765f432

Update message_data object with keys

Browse files
Files changed (1) hide show
  1. mathtext_fastapi/nlu.py +8 -8
mathtext_fastapi/nlu.py CHANGED
@@ -62,14 +62,14 @@ def evaluate_message_with_nlu(message_data):
62
  message_text = message_data['message_body']
63
  except KeyError:
64
  message_data = {
65
- message_data['message']['_vnd']['v1']['chat']['owner'],
66
- message_data['message']['_vnd']['v1']['author']['type'],
67
- message_data['message']['_vnd']['v1']['chat']['contact_uuid'],
68
- message_data['message']['text']['body'],
69
- message_data['message']['_vnd']['v1']['direction'],
70
- message_data['message']['id'],
71
- message_data['message']['_vnd']['v1']['chat']['inserted_at'],
72
- message_data['message']['_vnd']['v1']['chat']['updated_at'],
73
  }
74
  message_text = message_data['message_body']
75
  message_text_arr = re.split(", |,| ", message_text.strip())
 
62
  message_text = message_data['message_body']
63
  except KeyError:
64
  message_data = {
65
+ 'author_id': message_data['message']['_vnd']['v1']['chat']['owner'],
66
+ 'author_type': message_data['message']['_vnd']['v1']['author']['type'],
67
+ 'contact_uuid': message_data['message']['_vnd']['v1']['chat']['contact_uuid'],
68
+ 'message_body': message_data['message']['text']['body'],
69
+ 'message_direction': message_data['message']['_vnd']['v1']['direction'],
70
+ 'message_id': message_data['message']['id'],
71
+ 'message_inserted_at': message_data['message']['_vnd']['v1']['chat']['inserted_at'],
72
+ 'message_updated_at': message_data['message']['_vnd']['v1']['chat']['updated_at'],
73
  }
74
  message_text = message_data['message_body']
75
  message_text_arr = re.split(", |,| ", message_text.strip())