diff options
author | Alexander_Kabui | 2024-03-25 16:54:03 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-03-25 16:54:03 +0300 |
commit | 28206304559e4c6582bdb5ba8700fc8e3d6f2d8b (patch) | |
tree | 2e18660376a5a297faef6025c616f3304d651552 | |
parent | e1ab3b849a209abb15c884d92b7aea456656637c (diff) | |
download | genenetwork3-28206304559e4c6582bdb5ba8700fc8e3d6f2d8b.tar.gz |
enable logigng info for api <rating>
-rw-r--r-- | gn3/api/llm.py | 6 |
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 |