aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorAlexander_Kabui2024-03-25 17:05:18 +0300
committerAlexander_Kabui2024-03-25 17:05:18 +0300
commitfed49b9148a5b73afd2bea99ec4f40cedb6c1c95 (patch)
tree68ab433940a44f19f79b686012bb17c56921b7c4 /gn3/api
parent28206304559e4c6582bdb5ba8700fc8e3d6f2d8b (diff)
downloadgenenetwork3-fed49b9148a5b73afd2bea99ec4f40cedb6c1c95.tar.gz
fix user_id type
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/llm.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py
index b4c6981..d46523c 100644
--- a/gn3/api/llm.py
+++ b/gn3/api/llm.py
@@ -77,8 +77,7 @@ def rating(task_id):
results.get("answer"),
results.get("weight", 0))
-
- logging.debug("the user id is %s",user_id)
+ logging.debug("the user id %s", str(user_id))
with db.connection(os.path.join(current_app.config["DATA_DIR"], "/llm.db")) as conn:
cursor = conn.cursor()
@@ -90,11 +89,11 @@ def rating(task_id):
task_id TEXT NOT NULL UNIQUE
)"""
cursor.execute(create_table)
- cursor.execute("""INSERT INTO Rating("user_name",query,answer,weight,task_id)
+ cursor.execute("""INSERT INTO Rating(user_id,query,answer,weight,task_id)
VALUES(?,?,?,?,?)
ON CONFLICT(task_id) DO UPDATE SET
weight=excluded.weight
- """, (user_id, query, answer, weight, task_id))
+ """, (str(user_id), query, answer, weight, task_id))
return {
"message": "success",
"status": 0