Update app.py
Browse files
app.py
CHANGED
|
@@ -49,7 +49,7 @@ def cs_body():
|
|
| 49 |
message_placeholder.write("I am working..")
|
| 50 |
# st.session_state.messages.append({"role": "assistant", "content": "I am working..", "type": "text"})
|
| 51 |
|
| 52 |
-
for message in st.session_state.messages:
|
| 53 |
with st.chat_message(message["role"]):
|
| 54 |
# if type is text
|
| 55 |
if message["type"] == "text":
|
|
@@ -57,9 +57,10 @@ def cs_body():
|
|
| 57 |
# if type is dataframe
|
| 58 |
if message["type"] == "dataframe":
|
| 59 |
st.dataframe(message["content"])
|
| 60 |
-
|
| 61 |
-
st.session_state.messages.append({"role": "assistant", "content": "I am working..", "type": "text"})
|
| 62 |
st.session_state.messages.append({"role": "user", "content": prompt, "type": "text"})
|
|
|
|
|
|
|
| 63 |
|
| 64 |
env.subheader('Enviornment:')
|
| 65 |
return None
|
|
|
|
| 49 |
message_placeholder.write("I am working..")
|
| 50 |
# st.session_state.messages.append({"role": "assistant", "content": "I am working..", "type": "text"})
|
| 51 |
|
| 52 |
+
for message in reversed(st.session_state.messages):
|
| 53 |
with st.chat_message(message["role"]):
|
| 54 |
# if type is text
|
| 55 |
if message["type"] == "text":
|
|
|
|
| 57 |
# if type is dataframe
|
| 58 |
if message["type"] == "dataframe":
|
| 59 |
st.dataframe(message["content"])
|
| 60 |
+
|
|
|
|
| 61 |
st.session_state.messages.append({"role": "user", "content": prompt, "type": "text"})
|
| 62 |
+
st.session_state.messages.append({"role": "assistant", "content": "I am working..", "type": "text"})
|
| 63 |
+
|
| 64 |
|
| 65 |
env.subheader('Enviornment:')
|
| 66 |
return None
|