ghengx
commited on
Commit
·
0fb34fb
1
Parent(s):
c31c056
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,6 +27,9 @@ if "messages" not in st.session_state:
|
|
| 27 |
if "auth" not in st.session_state:
|
| 28 |
st.session_state.auth = False
|
| 29 |
|
|
|
|
|
|
|
|
|
|
| 30 |
if st.session_state.auth:
|
| 31 |
for message in st.session_state.messages:
|
| 32 |
with st.chat_message(message["role"]):
|
|
@@ -44,6 +47,11 @@ if st.session_state.auth:
|
|
| 44 |
typed_response += chunk
|
| 45 |
placeholder.markdown(typed_response)
|
| 46 |
time.sleep(0.01)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
st.session_state.messages.append({"role": "assistant", "content": typed_response})
|
| 49 |
else:
|
|
|
|
| 27 |
if "auth" not in st.session_state:
|
| 28 |
st.session_state.auth = False
|
| 29 |
|
| 30 |
+
if "chart" not in st.session_state:
|
| 31 |
+
st.session_state.chart = None
|
| 32 |
+
|
| 33 |
if st.session_state.auth:
|
| 34 |
for message in st.session_state.messages:
|
| 35 |
with st.chat_message(message["role"]):
|
|
|
|
| 47 |
typed_response += chunk
|
| 48 |
placeholder.markdown(typed_response)
|
| 49 |
time.sleep(0.01)
|
| 50 |
+
|
| 51 |
+
if st.session_state.chart:
|
| 52 |
+
st.chat_message("assistant").plotly_chart(
|
| 53 |
+
st.session_state.chart
|
| 54 |
+
)
|
| 55 |
|
| 56 |
st.session_state.messages.append({"role": "assistant", "content": typed_response})
|
| 57 |
else:
|