This commit is contained in:
ahmed531998 2023-04-19 15:44:22 +02:00
parent fa03819253
commit 6680cdc612
1 changed files with 2 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import os
import re
import psycopg2
import requests
import time
app = Flask(__name__)
url = os.getenv("FRONTEND_URL_WITH_PORT")
cors = CORS(app, resources={r"/api/predict": {"origins": url},
@ -48,6 +48,7 @@ def init_dm():
return message
@app.route("/api/predict", methods=['POST'])
def predict():
time.sleep(10)
text = request.get_json().get("message")
message = {"answer": "answer", "query": "text", "cand": "candidate", "history": "history", "modQuery": "modQuery"}
reply = jsonify(message)