Update app.py
Browse files
app.py
CHANGED
|
@@ -264,7 +264,7 @@ users = session.query(User).all()
|
|
| 264 |
credentials = {
|
| 265 |
"usernames": {
|
| 266 |
user.username: {
|
| 267 |
-
"name": user.username, #
|
| 268 |
"password": user.password # This should be the hashed password
|
| 269 |
}
|
| 270 |
for user in users
|
|
@@ -275,6 +275,9 @@ credentials = {
|
|
| 275 |
if not users:
|
| 276 |
credentials = {"usernames": {}}
|
| 277 |
|
|
|
|
|
|
|
|
|
|
| 278 |
# Initialize Authenticator with keyword arguments
|
| 279 |
authenticator = stauth.Authenticate(
|
| 280 |
credentials,
|
|
@@ -541,13 +544,13 @@ if authentication_status:
|
|
| 541 |
else:
|
| 542 |
st.session_state.chat_history.append(("You", user_input))
|
| 543 |
ai_response = get_ai_response(user_input)
|
| 544 |
-
st.session_state.chat_history.append(("CITIBANK AI", ai_response))
|
| 545 |
|
| 546 |
for sender, message in st.session_state.chat_history:
|
| 547 |
if sender == "You":
|
| 548 |
st.markdown(f"**You:** {message}")
|
| 549 |
else:
|
| 550 |
-
st.markdown(f"**CITIBANK AI:** {message}")
|
| 551 |
|
| 552 |
# ========================
|
| 553 |
# About Me Tab
|
|
|
|
| 264 |
credentials = {
|
| 265 |
"usernames": {
|
| 266 |
user.username: {
|
| 267 |
+
"name": user.username, # You can customize this if you have a separate name field
|
| 268 |
"password": user.password # This should be the hashed password
|
| 269 |
}
|
| 270 |
for user in users
|
|
|
|
| 275 |
if not users:
|
| 276 |
credentials = {"usernames": {}}
|
| 277 |
|
| 278 |
+
# Debugging: Display credentials structure (Remove or comment out in production)
|
| 279 |
+
# st.write("Credentials Structure:", credentials)
|
| 280 |
+
|
| 281 |
# Initialize Authenticator with keyword arguments
|
| 282 |
authenticator = stauth.Authenticate(
|
| 283 |
credentials,
|
|
|
|
| 544 |
else:
|
| 545 |
st.session_state.chat_history.append(("You", user_input))
|
| 546 |
ai_response = get_ai_response(user_input)
|
| 547 |
+
st.session_state.chat_history.append(("CITIBANK DEMO BUSINESS INC AI", ai_response))
|
| 548 |
|
| 549 |
for sender, message in st.session_state.chat_history:
|
| 550 |
if sender == "You":
|
| 551 |
st.markdown(f"**You:** {message}")
|
| 552 |
else:
|
| 553 |
+
st.markdown(f"**CITIBANK DEMO BUSINESS INC AI:** {message}")
|
| 554 |
|
| 555 |
# ========================
|
| 556 |
# About Me Tab
|