File size: 468 Bytes
35666dc 335f4a7 35666dc 335f4a7 35666dc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
from flask import Flask, request, jsonify, render_template
app = Flask(__name__)
@app.route("/")
def home():
return render_template("index.html")
@app.route("/chat", methods=["POST"])
def chat():
user_input = request.json.get("message", "")
if not user_input:
return jsonify({"error": "Empty input"}), 400
return jsonify({"response": f"Dummy response for: {user_input}"})
if __name__ == "__main__":
app.run(host="0.0.0.0", port=7860)
|