Update app.py
Browse files
app.py
CHANGED
@@ -39,7 +39,14 @@ st.title(TITLE)
|
|
39 |
st.write(DESCRIPTION)
|
40 |
|
41 |
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
# React to user input
|
44 |
if prompt := st.chat_input("Ask Palm 2 anything..."):
|
45 |
# Display user message in chat message container
|
|
|
39 |
st.write(DESCRIPTION)
|
40 |
|
41 |
|
42 |
+
if "messages" not in st.session_state:
|
43 |
+
st.session_state.messages = []
|
44 |
+
|
45 |
+
# Display chat messages from history on app rerun
|
46 |
+
for message in st.session_state.messages:
|
47 |
+
with st.chat_message(message["role"]):
|
48 |
+
st.markdown(message["content"])
|
49 |
+
|
50 |
# React to user input
|
51 |
if prompt := st.chat_input("Ask Palm 2 anything..."):
|
52 |
# Display user message in chat message container
|