Esempio n. 1
0
def show_human_data():
    intents = get_all_intents()

    for intent in intents:
      intent['expressions'] = show_expressions_for_intent(intent.get('name'))
      intent['name'] = serialize.from_string(intent.get('name'))

    return json_success({
        'intents': intents
    })
Esempio n. 2
0
def new_training_data():
    try:
        training_data = request.get_json()
        if training_data is None:
            raise BadRequest(description=NO_JSON)
        train(training_data)
    except BadRequest as e:
        return json_error_message('Failed to parse JSON data',
                                  error_data=e.description)

    return json_success('Training data added successfully')
Esempio n. 3
0
def show_expressions(intent):
    return json_success({
        'data': show_expressions_for_intent(intent)
    })
Esempio n. 4
0
def view_training_data():
  return json_success(show_expressions_for_intent('walk_the_hog'))
Esempio n. 5
0
def hello_world():
    return json_success("Hello World!")