aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
Diffstat (limited to 'gn3')
-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