chatbot-deployment icon indicating copy to clipboard operation
chatbot-deployment copied to clipboard

My messages are not showing up after i enter and i am not able to fetch the json data

Open alay28 opened this issue 3 years ago • 8 comments

Screenshot (27) Screenshot (28) Screenshot (29) Screenshot (30)

Here are the screenshots of the error and the code.Any help would be appreciated

alay28 avatar Oct 15 '21 19:10 alay28

Same problem here. I hope he responds

holywales avatar Nov 16 '21 18:11 holywales

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)

Tabinda788 avatar Sep 22 '22 09:09 Tabinda788

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)

anoozhka avatar Aug 22 '23 12:08 anoozhka

please help me the chatbox icon isn't opening Screenshot (80)

RPNSammieJee avatar Feb 15 '24 12:02 RPNSammieJee

@anoozhka please can you share the app.js code with me that works

RPNSammieJee avatar Feb 15 '24 13:02 RPNSammieJee

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)

Mitodru2002 avatar May 05 '24 15:05 Mitodru2002

please help me the chatbox icon isn't opening Screenshot (80)

same issue can you please help

kilvish01 avatar Jun 25 '24 11:06 kilvish01

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

kilvish01 avatar Jun 25 '24 13:06 kilvish01