from flask import Flask, request, session | |
from flask import render_template, redirect, url_for | |
from twilio.twiml.messaging_response import MessagingResponse | |
from joy import ask | |
app = Flask(__name__) | |
#app.config[‘SECRET_KEY’] = ‘any-random-string’ what is this for? | |
def joy(): | |
incoming_msg = request.values['Body'] | |
chat_log = session.get('chat_log') | |
answer, session['chat_log'] = ask(incoming_msg, chat_log) | |
msg = MessagingResponse() | |
msg.message(answer) | |
return str(msg) | |
if __name__ == '__main__': | |
app.run(debug=True) |