run.py 408 B

1234567891011121314
  1. from bot_config import *
  2. from chatterbot import ChatBot
  3. from flask import Flask, render_template, request
  4. my_bot = ChatBot(name=bot_name, read_only=bot_read_only)
  5. app = Flask(__name__)
  6. @app.route("/get", methods = ['GET', 'POST'])
  7. def get_bot_response():
  8. userText = request.values.get('text')
  9. return str(my_bot.get_response(userText))
  10. if __name__ == "__main__":
  11. app.run()