I started recently developing amazon alexa skills i developed a code which will interact with mysql db which is as below. I am using flask-ask framework and interacting with database its having two questions after answering a question the skill is getting closed and again i need to invoke the skill to use it again. I have gone through the flask-ask documentation where i have seen that if i can make 'shouldEndSession' = False i can access the skill anytime but i am not getting how can i add to my code.Please help me how can i add this to my code.
import logging from flaskext.mysql import MySQL from flask import Flask, render_template from flask_ask import Ask, statement, question mysql = MySQL() app = Flask(__name__) app.config.from_object(__name__) app.config['MYSQL_DATABASE_USER'] = 'User_Name' app.config['MYSQL_DATABASE_PASSWORD'] = 'password' app.config['MYSQL_DATABASE_DB'] = 'DB_Name' app.config['MYSQL_DATABASE_HOST'] = 'HostName' mysql.init_app(app) ask = Ask(app, "/") logging.getLogger("flask_ask").setLevel(logging.DEBUG) @ask.launch def new_conference(): welcome_msg = render_template('welcome') return question(welcome_msg) @ask.intent("SpeakerIntent") def ask_if_speaker(employee_name): employee_name = employee_name cursor = mysql.connect().cursor() cursor.execute( "SELECT id from emp " "WHERE emp.name LIKE '%" + employee_name + "%';") data = cursor.fetchall() if data is None: message = "There was no employee by that name." else: message = "Employee id of the employee is"%data return statement(message) @ask.intent("CountIntent") def ask_if_speaker(department): department = department cursor = mysql.connect().cursor() cursor.execute( "SELECT count(*) from employee " "WHERE Department LIKE '%" + department + "%';") data = cursor.fetchall() if data is None: message = "There was no employee in the department." else: message = "The employee count in department is"%data return statement(message) if __name__ == '__main__': app.run(debug=True)