Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -56,10 +56,11 @@ def index():
|
|
56 |
def process_json():
|
57 |
content_type = request.headers.get('Content-Type')
|
58 |
if (content_type == 'application/json'):
|
59 |
-
|
60 |
-
|
|
|
61 |
pretty_print_docs(response['source_documents'])
|
62 |
-
print("Ques:>>>>"+
|
63 |
return jsonify(botMessage=responseJSON["result"]);
|
64 |
else:
|
65 |
return 'Content-Type not supported!'
|
|
|
56 |
def process_json():
|
57 |
content_type = request.headers.get('Content-Type')
|
58 |
if (content_type == 'application/json'):
|
59 |
+
|
60 |
+
userQuery = request.get_json()['query']
|
61 |
+
responseJSON=chain({"question":userQuery});
|
62 |
pretty_print_docs(response['source_documents'])
|
63 |
+
print("Ques:>>>>"+userQuery+"\n Ans:>>>"+responseJSON["result"])
|
64 |
return jsonify(botMessage=responseJSON["result"]);
|
65 |
else:
|
66 |
return 'Content-Type not supported!'
|