From 748ebc5baff3412df163e17ee18a8fc688329b1d Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Mon, 2 Sep 2024 15:08:59 +0300 Subject: Use default datetime for table. --- gn3/api/llm.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gn3') 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 -- cgit v1.2.3