Spaces:
Runtime error
Runtime error
Update application.py
Browse files- application.py +4 -4
application.py
CHANGED
|
@@ -54,15 +54,15 @@ def create_prompt(context, user_input):
|
|
| 54 |
def render_markdown(text):
|
| 55 |
return markdown2.markdown(text)
|
| 56 |
|
| 57 |
-
@
|
| 58 |
def index():
|
| 59 |
return render_template('index.html')
|
| 60 |
|
| 61 |
-
@
|
| 62 |
def send_static(path):
|
| 63 |
return send_from_directory('static', path)
|
| 64 |
|
| 65 |
-
@
|
| 66 |
def chat():
|
| 67 |
user_input = request.json['message']
|
| 68 |
|
|
@@ -82,7 +82,7 @@ def chat():
|
|
| 82 |
|
| 83 |
return jsonify({"response": formatted_response})
|
| 84 |
|
| 85 |
-
@
|
| 86 |
def shutdown():
|
| 87 |
if request.environ.get('werkzeug.server.shutdown'):
|
| 88 |
shutdown_server()
|
|
|
|
| 54 |
def render_markdown(text):
|
| 55 |
return markdown2.markdown(text)
|
| 56 |
|
| 57 |
+
@app.route('/')
|
| 58 |
def index():
|
| 59 |
return render_template('index.html')
|
| 60 |
|
| 61 |
+
@app.route('/static/<path:path>')
|
| 62 |
def send_static(path):
|
| 63 |
return send_from_directory('static', path)
|
| 64 |
|
| 65 |
+
@app.route('/chat', methods=['POST'])
|
| 66 |
def chat():
|
| 67 |
user_input = request.json['message']
|
| 68 |
|
|
|
|
| 82 |
|
| 83 |
return jsonify({"response": formatted_response})
|
| 84 |
|
| 85 |
+
@app.route('/shutdown', methods=['POST'])
|
| 86 |
def shutdown():
|
| 87 |
if request.environ.get('werkzeug.server.shutdown'):
|
| 88 |
shutdown_server()
|