jeonghin commited on
Commit
8bf8033
1 Parent(s): c9a1f96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -168,7 +168,7 @@ def increment_user_chat_count(user_id):
168
  cursor = conn.cursor()
169
 
170
  cursor.execute(
171
- "UPDATE birdseye_chat SET count = 14 WHERE user_id = %s ;", (user_id,)
172
  )
173
  conn.commit()
174
  except mysql.connector.Error as err:
@@ -241,6 +241,7 @@ def chat(slug, user_id):
241
 
242
  # User-provided prompt
243
  if prompt := st.chat_input():
 
244
  st.session_state.messages.append({"role": "user", "content": prompt})
245
  st.session_state.prompts = prompt
246
  with st.chat_message("user"):
 
168
  cursor = conn.cursor()
169
 
170
  cursor.execute(
171
+ "UPDATE birdseye_chat SET count = count + 1 WHERE user_id = %s ", (user_id,)
172
  )
173
  conn.commit()
174
  except mysql.connector.Error as err:
 
241
 
242
  # User-provided prompt
243
  if prompt := st.chat_input():
244
+ increment_user_chat_count(user_id)
245
  st.session_state.messages.append({"role": "user", "content": prompt})
246
  st.session_state.prompts = prompt
247
  with st.chat_message("user"):