コード例 #1
0
def start_coversation():
    if ('msg' in request.args):
        text = request.args['msg']
        start_conv_msg = cs.start_converation_action(text)
        conversation_list_history.append(start_conv_msg)
        # db_handler = mongo.db.chathistory
        # db_handler.insert({"request_user_id": request_user_id, "conversation": conversation_list_history,
        #                    "time": now_india.strftime(fmt)})
        # db_handler.update({"request_user_id": request_user_id}, {
        #     '$set': {"request_user_id": request_user_id, "conversation": conversation_list_history, "time": now_india.strftime(fmt)},
        resp = Response(start_conv_msg, status=200, mimetype='application/json')
        return resp
コード例 #2
0
def start_coversation():
    if ('msg' in request.args):
        text = request.args['msg']
        start_conv_msg = cs.start_converation_action(text)
        conversation_list_history.append(start_conv_msg)
        # db_handler = mongo.db.chathistory
        # db_handler.insert({"request_user_id": request_user_id, "conversation": conversation_list_history,
        #                    "time": now_india.strftime(fmt)})
        # db_handler.update({"request_user_id": request_user_id}, {
        #     '$set': {"request_user_id": request_user_id, "conversation": conversation_list_history, "time": now_india.strftime(fmt)},
        resp = Response(start_conv_msg, status=200, mimetype='application/json')
        return resp