First I have enabled the API by using
rasa run -m models --enable-api --cors "*" --debug
then I tested that using postman; it's showing the intent ranking:
In the next step want to run web, so I have the written a Flask app.
from flask import Flask, render_template, url_for, request, jsonify
import requests
app = Flask(__name__)
#@app.route('/')
#def hello_world():
#return render_template('home.html')
@app.route('/chat',methods=["POST"])
def chat():
user_message = request.form['text']
response = requests.post("http://localhost:5005/model/parse", params ={"message": user_message} )
return jsonify({"status":"success","response":response_text})
if __name__ == "__main__":
app.run(debug = True, port = 5000)
but I'm unable to fetch the intent ranking over there. This the output while I'm using flask app:
Can someone help me sort this out?