Spaces:
Sleeping
Sleeping
Commit
·
e4966b2
1
Parent(s):
2d2c67f
Update main.py
Browse files
main.py
CHANGED
|
@@ -4,6 +4,14 @@ from flask import request, Flask
|
|
| 4 |
#from dotenv import load_dotenv
|
| 5 |
#load_dotenv()
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
app = Flask(__name__)
|
| 8 |
|
| 9 |
@app.route('/api/chat', methods=['POST'])
|
|
@@ -11,4 +19,4 @@ def chatbot():
|
|
| 11 |
data = request.get_json()
|
| 12 |
user_query = data['user_question']
|
| 13 |
print(user_query)
|
| 14 |
-
return {"
|
|
|
|
| 4 |
#from dotenv import load_dotenv
|
| 5 |
#load_dotenv()
|
| 6 |
|
| 7 |
+
#Pay attention to flask request vs python requests
|
| 8 |
+
#https://tedboy.github.io/flask/generated/generated/flask.Request.html
|
| 9 |
+
#Flask API: https://tedboy.github.io/flask/index.html#
|
| 10 |
+
|
| 11 |
+
#Python Requests: https://pypi.org/project/requests/
|
| 12 |
+
#python -m pip install requests
|
| 13 |
+
#import requests
|
| 14 |
+
|
| 15 |
app = Flask(__name__)
|
| 16 |
|
| 17 |
@app.route('/api/chat', methods=['POST'])
|
|
|
|
| 19 |
data = request.get_json()
|
| 20 |
user_query = data['user_question']
|
| 21 |
print(user_query)
|
| 22 |
+
return {"Message":"Flask API /api/chat Deploy Success on HF"}
|