Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
82 |
-
st.
|
|
|
|
|
|
|
|
|
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.
|