Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -4,7 +4,7 @@ import time
|
|
4 |
from flask_cors import CORS
|
5 |
import yaml
|
6 |
import re
|
7 |
-
import conversation
|
8 |
import ast
|
9 |
|
10 |
|
@@ -325,26 +325,26 @@ def generateQuestions():
|
|
325 |
except Exception as e:
|
326 |
return jsonify({'error': str(e)}), 500
|
327 |
|
328 |
-
# Yazid Methode starts here
|
329 |
-
@app.route('/ask', methods=['OPTIONS'])
|
330 |
-
def options_ask():
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
|
338 |
-
@app.route('/ask', methods=['POST'])
|
339 |
-
def ask_question():
|
340 |
-
|
341 |
-
|
342 |
|
343 |
-
|
344 |
-
|
345 |
|
346 |
-
|
347 |
-
# Yazid Methode ends here
|
348 |
|
349 |
|
350 |
# History approach starts here :
|
|
|
4 |
from flask_cors import CORS
|
5 |
import yaml
|
6 |
import re
|
7 |
+
# import conversation
|
8 |
import ast
|
9 |
|
10 |
|
|
|
325 |
except Exception as e:
|
326 |
return jsonify({'error': str(e)}), 500
|
327 |
|
328 |
+
# # Yazid Methode starts here
|
329 |
+
# @app.route('/ask', methods=['OPTIONS'])
|
330 |
+
# def options_ask():
|
331 |
+
# response = make_response()
|
332 |
+
# response.headers.add("Access-Control-Allow-Origin", "*")
|
333 |
+
# response.headers.add("Access-Control-Allow-Methods", "POST")
|
334 |
+
# response.headers.add("Access-Control-Allow-Headers", "Content-Type, Authorization")
|
335 |
+
# response.headers.add("Access-Control-Allow-Credentials", "true")
|
336 |
+
# return response
|
337 |
|
338 |
+
# @app.route('/ask', methods=['POST'])
|
339 |
+
# def ask_question():
|
340 |
+
# data = request.get_json()
|
341 |
+
# question = data.get('question', '')
|
342 |
|
343 |
+
# # Call your conversation logic here
|
344 |
+
# result = conversation.ask_question(question)
|
345 |
|
346 |
+
# return jsonify(result)
|
347 |
+
# # Yazid Methode ends here
|
348 |
|
349 |
|
350 |
# History approach starts here :
|