Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,7 +62,7 @@ def initialize_services():
|
|
| 62 |
def home():
|
| 63 |
return render_template('index.html')
|
| 64 |
|
| 65 |
-
@app.route('/
|
| 66 |
def chat():
|
| 67 |
if not models_loaded:
|
| 68 |
return jsonify({
|
|
@@ -92,7 +92,8 @@ def chat():
|
|
| 92 |
|
| 93 |
return jsonify({
|
| 94 |
"response": response,
|
| 95 |
-
"timestamp": datetime.utcnow().isoformat()
|
|
|
|
| 96 |
})
|
| 97 |
|
| 98 |
except Exception as e:
|
|
@@ -108,4 +109,4 @@ def get_history():
|
|
| 108 |
|
| 109 |
if __name__ == '__main__':
|
| 110 |
initialize_services()
|
| 111 |
-
app.run(host='0.0.0.0', port=8000)
|
|
|
|
| 62 |
def home():
|
| 63 |
return render_template('index.html')
|
| 64 |
|
| 65 |
+
@app.route('/ask', methods=['POST']) # Updated endpoint to match HTML
|
| 66 |
def chat():
|
| 67 |
if not models_loaded:
|
| 68 |
return jsonify({
|
|
|
|
| 92 |
|
| 93 |
return jsonify({
|
| 94 |
"response": response,
|
| 95 |
+
"timestamp": datetime.utcnow().isoformat(),
|
| 96 |
+
"quickReplies": [] # You can add logic here to provide quick replies if needed
|
| 97 |
})
|
| 98 |
|
| 99 |
except Exception as e:
|
|
|
|
| 109 |
|
| 110 |
if __name__ == '__main__':
|
| 111 |
initialize_services()
|
| 112 |
+
app.run(host='0.0.0.0', port=8000)
|