about summary refs log tree commit diff
path: root/gn3/api
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/llm.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py
index 7414ff8..b4c6981 100644
--- a/gn3/api/llm.py
+++ b/gn3/api/llm.py
@@ -18,6 +18,7 @@ from gn3.auth import db
 from redis import Redis
 import os
 import json
+import logging
 import sqlite3
 from datetime import timedelta
 
@@ -76,6 +77,9 @@ def rating(task_id):
                                               results.get("answer"),
                                               results.get("weight", 0))
 
+
+            logging.debug("the user id is  %s",user_id)
+
             with db.connection(os.path.join(current_app.config["DATA_DIR"], "/llm.db")) as conn:
                 cursor = conn.cursor()
                 create_table = """CREATE TABLE IF NOT EXISTS Rating(
@@ -86,7 +90,7 @@ def rating(task_id):
                       task_id TEXT NOT NULL UNIQUE
                       )"""
                 cursor.execute(create_table)
-                cursor.execute("""INSERT INTO Rating(user_id,query,answer,weight,task_id)
+                cursor.execute("""INSERT INTO Rating("user_name",query,answer,weight,task_id)
                 VALUES(?,?,?,?,?)
                 ON CONFLICT(task_id) DO UPDATE SET
                 weight=excluded.weight