i have file named app.py which contain the flask app of my rasa chatbot the code of app.py file = from flask import Flask, render_template, request, jsonify import requests
RASA_API_URL = ‘http://localhost:5005/webhooks/rest/webhook’ app = Flask(name)
@app.route(‘/’) def index(): return render_template(‘index.html’)
@app.route(‘/webhook’, methods=[‘POST’]) def webhook(): user_message = request.json[‘message’] print(“User Message:”, user_message)
Send user message to Rasa and get bot’s response
rasa_response = requests.post(RASA_API_URL, json = { 'message': user_message})
rasa_response_json = rasa_response.json()
print("Rasa Response:", rasa_response_json)
bot_response = rasa_response_json[0]['text'] if rasa_response_json else ('Sorry, I didn\'t ''understand that.')
return jsonify({'response': bot_response})
if name == ‘main’: app.run(debug=True,port=3000)
, so i want to connect my sql database named backup from phpmyadmin to my rasa chatbot , this database contain the responses of our chatbot andgive me the code to define the questions of users as intents in nlu.yml file , give me all the codes that will be able to connect my rasa chatbot in flsask app to our database as responses of our chatbot with the intents as questions of users that is gives the possibility to fetch and display the content of column nom of our table atsufas1 from our database