aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
authorAlexander_Kabui2024-03-25 16:54:03 +0300
committerAlexander_Kabui2024-03-25 16:54:03 +0300
commit28206304559e4c6582bdb5ba8700fc8e3d6f2d8b (patch)
tree2e18660376a5a297faef6025c616f3304d651552 /gn3
parente1ab3b849a209abb15c884d92b7aea456656637c (diff)
downloadgenenetwork3-28206304559e4c6582bdb5ba8700fc8e3d6f2d8b.tar.gz
enable logigng info for api <rating>
Diffstat (limited to 'gn3')
-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