From fed49b9148a5b73afd2bea99ec4f40cedb6c1c95 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Mon, 25 Mar 2024 17:05:18 +0300 Subject: fix user_id type --- gn3/api/llm.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gn3/api') 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 -- cgit v1.2.3