ayush2917 commited on
Commit
34e8f77
·
verified ·
1 Parent(s): 6933a1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -62,7 +62,7 @@ def initialize_services():
62
  def home():
63
  return render_template('index.html')
64
 
65
- @app.route('/api/chat', methods=['POST'])
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)