diff options
author | Alexander_Kabui | 2024-09-02 15:08:59 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-09-02 15:08:59 +0300 |
commit | 748ebc5baff3412df163e17ee18a8fc688329b1d (patch) | |
tree | 52fec829ce46f9784bc0d55af481234809017f5f | |
parent | 9c6f74d0a3f16a940b333d2a56803ed2e7d7c462 (diff) | |
download | genenetwork3-748ebc5baff3412df163e17ee18a8fc688329b1d.tar.gz |
Use default datetime for table.
-rw-r--r-- | gn3/api/llm.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py index 836a880..a617faf 100644 --- a/gn3/api/llm.py +++ b/gn3/api/llm.py @@ -75,12 +75,11 @@ def rate_queries(task_id): PRIMARY KEY(task_id))""" cursor.execute(create_table) cursor.execute("""INSERT INTO Rating(user_id, query, - answer, weight, task_id, created_at) - VALUES(?, ?, ?, ?, ?, ?) + answer, weight, task_id) + VALUES(?, ?, ?, ?, ?) ON CONFLICT(task_id) DO UPDATE SET weight=excluded.weight - """, (str(user_id), query, answer, weight, task_id, - datetime.now(timezone.utc))) + """, (str(user_id), query, answer, weight, task_id)) return { "message": "You have successfully rated this query.Thank you!" }, 200 |