Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 =
|
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"):
|