Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alay28 opened this issue Oct 15, 2021 · 8 comments

Comments

@alay28
Copy link

alay28 commented Oct 15, 2021

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

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

@holywales
Copy link

Same problem here. I hope he responds

@Tabinda788
Copy link

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)

@anoozhka
Copy link

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)

@RPNSammieJee
Copy link

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

@RPNSammieJee
Copy link

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

@Mitodru2002
Copy link

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)

@kilvish01
Copy link

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

same issue can you please help

@kilvish01
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@holywales @Tabinda788 @alay28 @anoozhka @RPNSammieJee @kilvish01 @Mitodru2002 and others