aboutsummaryrefslogtreecommitdiff
path: root/gn3/api/llm.py
diff options
context:
space:
mode:
authorAlexander_Kabui2024-05-01 03:25:42 +0300
committerAlexander_Kabui2024-05-01 03:25:42 +0300
commit5ec3198db99aef74974023a094bd3df757ac8801 (patch)
treee5b0a5ddf99fc50f83fcc14c686ba1acbbcd2789 /gn3/api/llm.py
parent24771494483a6d616c7f244512dc6810d872a30e (diff)
downloadgenenetwork3-5ec3198db99aef74974023a094bd3df757ac8801.tar.gz
Debug: check for if config is loaded in gn3.
Diffstat (limited to 'gn3/api/llm.py')
-rw-r--r--gn3/api/llm.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py
index e19077c..9163b76 100644
--- a/gn3/api/llm.py
+++ b/gn3/api/llm.py
@@ -61,8 +61,9 @@ def gnqa():
@require_oauth("profile")
def rating(task_id):
try:
+ llm_db_path = current_app.config["LLM_DB_PATH"]
with (require_oauth.acquire("profile") as token,
- db.connection(current_app.config.get("LLM_DB_PATH")) as conn):
+ db.connection(llm_db_path) as conn):
results = request.json
user_id, query, answer, weight = (token.user.user_id,
@@ -85,10 +86,12 @@ def rating(task_id):
""", (str(user_id), query, answer, weight, task_id))
return {
"message": "You have successfully rated this query:Thank you!!",
- "status": 0
+ "status": 0,
+ "db_path": llm_db_path
+
}, 200
except sqlite3.Error as error:
- return jsonify({"error": str(error)}), 500
+ return jsonify({"db_path": llm_db_path, "error": str(error)}), 500
except Exception as error:
raise error