History in headings
Browse files
app.py
CHANGED
@@ -29,10 +29,10 @@ elif mode == "Health Q&A":
|
|
29 |
save_interaction("Health Q&A", question, response)
|
30 |
st.session_state.history.append(("Health Q&A", question, response))
|
31 |
|
32 |
-
# Show history
|
33 |
with st.expander("π Show Previous Interactions"):
|
34 |
-
for
|
35 |
-
|
36 |
-
st.
|
37 |
-
|
38 |
-
|
|
|
29 |
save_interaction("Health Q&A", question, response)
|
30 |
st.session_state.history.append(("Health Q&A", question, response))
|
31 |
|
32 |
+
# Show history as clickable expandable headers
|
33 |
with st.expander("π Show Previous Interactions"):
|
34 |
+
for mode, query, response in st.session_state.history[::-1]:
|
35 |
+
heading = f"[{mode}] {query[:80]}{'...' if len(query) > 80 else ''}"
|
36 |
+
with st.expander(heading):
|
37 |
+
st.markdown("**Diagnosis / Answer:**")
|
38 |
+
st.write(response)
|