Exemple #1
0
 def __init__(self, post_data, private_key=None):
     if not isinstance(post_data, dict):
         post_data = json.loads(post_data)
     self.data = post_data
     self.request_start_time = Utils.get_millisecond()
     self.request_end_time = 0
     self.request = Request(post_data)
     self.audio_url = None
     self.app_name = None
     self.package_name = None
     self.deep_link = None
     self.event_start_time = 0
     self.event_cost_time = 0
     self.device_event_start_time = 0
     self.device_event_cost_time = 0
     self.user_event_list = {}
     self.is_event_make_pair = {}
     self.config = BotMonitorConfig()
     self.private_key = private_key
     self.environment = 0
     self.enabled = False
     self.certificate = None
     self.response = None
Exemple #2
0
 def __init__(self, postData):
     if isinstance(postData, str):
         postData = json.loads(postData)
     self.data = postData
     self.requestStartTime = self.getMillisecond()
     self.requestEndTime = 0
     self.request = Request(postData)
     self.audioUrl = None
     self.appName = None
     self.packageName = None
     self.deepLink = None
     self.eventStartTime = 0
     self.eventCostTime = 0
     self.deviceEventStartTime = 0
     self.deviceEventCostTime = 0
     self.userEventList = {}
     self.isEventMakePair = {}
     self.config = BotMonitorConfig()
     self.privateKey = None
     self.environment = 0
     self.enabled = True
     self.certificate = None
     self.response = None
Exemple #3
0
import json


class test_request:
    pass


if __name__ == '__main__':

    def requestData():
        with open("../data/intent_request_tax.json", 'r',
                  encoding='utf-8') as load_f:
            return load_f.read()

    requestData = requestData()

    request = Request(json.loads(requestData))

    print(request.get_type())
    print(request.get_user_id())
    print(request.get_query())
    print(request.get_bot_id())
    print(request.get_request_id())
    print(request.get_reson())
    print(request.get_intent_name())
    print(request.get_session_id())
    print(request.get_device_id())
    print(request.get_location())
    print(request.is_dialog_state_completed())
    pass