chatbot-deployment
chatbot-deployment copied to clipboard
My messages are not showing up after i enter and i am not able to fetch the json data
Here are the screenshots of the error and the code.Any help would be appreciated
Same problem here. I hope he responds
Change your app.py to this:
from flask import Flask, render_template,request,jsonify from flask_cors import CORS from chat import get_response
app = Flask(name) CORS(app) @app.route("/", methods=["GET"]) def index_get(): return render_template("base.html")
@app.route("/predict", methods=["POST"]) def predict(): text = request.get_json(force=True).get("message") # text = request.is_json().get("message") # text = "hi" response = get_response(text) message = {"answer": response} return jsonify(message)
if name == "main": app.run(debug=True)
this still has errors, i believe the correct code should be
from flask import Flask, render_template, request, jsonify from flask_cors import CORS from chat import get_response
app = Flask(name) CORS(app)
@app.route("/", methods=["GET"]) def index_get(): return render_template("base.html")
@app.route("/predict", methods=["POST"]) def predict(): text = request.get_json(force=True).get("message") response = get_response(text) message = {"answer": response} return jsonify(message)
if name == "main": app.run(debug=True)
please help me the chatbox icon isn't opening
@anoozhka please can you share the app.js code with me that works
Pease check this and let me know from flask import Flask, render_template, request, jsonify from flask_cors import CORS from chat import get_response
app=Flask(name, template_folder='template') CORS(app) @app.route("/", methods=["GET"]) def index_get(): return render_template("base.html")
@app.route("/predict", methods=["POST"]) def predict(): text = request.get_json(force=True).get("message") response = get_response(text) message = {"answer": response} return jsonify(message)
if name == "main": app.run(debug=True)
please help me the chatbox icon isn't opening
same issue can you please help
Pease check this and let me know from flask import Flask, render_template, request, jsonify from flask_cors import CORS from chat import get_response
app=Flask(name, template_folder='template') CORS(app) @app.route("/", methods=["GET"]) def index_get(): return render_template("base.html")
@app.route("/predict", methods=["POST"]) def predict(): text = request.get_json(force=True).get("message") response = get_response(text) message = {"answer": response} return jsonify(message)
if name == "main": app.run(debug=True)
still not working