VishnuRamDebyez commited on
Commit
ac8dcd7
·
verified ·
1 Parent(s): 52136b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -97,7 +97,7 @@ if st.sidebar.button("Clear Chat History"):
97
  # Display chat history
98
  st.sidebar.write("### Previous Questions")
99
  for idx, chat in enumerate(reversed(st.session_state.chat_history), 1):
100
- # Create a button for each previous question
101
- if st.sidebar.button(f"Question {len(st.session_state.chat_history) - idx + 1}: {chat['question']}"):
102
- # Display the corresponding answer when the button is clicked
103
- st.sidebar.write(f"**Answer:** {chat['answer']}")
 
97
  # Display chat history
98
  st.sidebar.write("### Previous Questions")
99
  for idx, chat in enumerate(reversed(st.session_state.chat_history), 1):
100
+ # Expander for each chat history item
101
+ with st.sidebar.expander(f"Question {len(st.session_state.chat_history) - idx + 1}"):
102
+ st.write(f"**Question:** {chat['question']}")
103
+ st.write(f"**Answer:** {chat['answer']}")