hashirehtisham commited on
Commit
5e0ac93
1 Parent(s): e338624

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -78,8 +78,12 @@ if "messages" not in st.session_state:
78
 
79
  # Display the existing chat messages via st.chat_message.
80
  for message in st.session_state.messages:
81
- with st.chat_message(message["role"]):
82
- st.markdown(message["content"])
 
 
 
 
83
 
84
  # Create a chat input field to allow the user to enter a message. This will display
85
  # automatically at the bottom of the page.
 
78
 
79
  # Display the existing chat messages via st.chat_message.
80
  for message in st.session_state.messages:
81
+ if message["role"] == "assistant":
82
+ with st.chat_message("assistant"):
83
+ st.markdown(message["content"])
84
+ elif message["role"] == "user":
85
+ with st.chat_message("user"):
86
+ st.markdown(message["content"])
87
 
88
  # Create a chat input field to allow the user to enter a message. This will display
89
  # automatically at the bottom of the page.