API conversation

This commit is contained in:
Alex
2023-02-25 13:36:03 +00:00
parent 6cd98d631d
commit 6eef53cb1b
4 changed files with 46 additions and 21 deletions

View File

@@ -1,5 +1,6 @@
import os
import json
import traceback
import dotenv
import requests
@@ -86,7 +87,6 @@ def api_answer():
# use try and except to check for exception
try:
# check if the vectorstore is set
if "active_docs" in data:
vectorstore = "vectors/" + data["active_docs"]
@@ -144,6 +144,8 @@ def api_answer():
# }
return result
except Exception as e:
# print whole traceback
traceback.print_exc()
print(str(e))
return bad_request(500,str(e))
@@ -185,4 +187,4 @@ def after_request(response):
if __name__ == "__main__":
app.run(debug=True)
app.run(debug=True, port=5001)