Skip to content

Commit

Permalink
Refactor conversation selection
Browse files Browse the repository at this point in the history
  • Loading branch information
mache102 committed May 1, 2023
1 parent 8b0cb0c commit 2140fc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gui/streamlit_chat_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def exit_handler():
for idx, conversation in enumerate(st.session_state.conversations):
if st.sidebar.button(f"Conversation {idx + 1}: {conversation['user_inputs'][0]}", key=f"sidebar_btn_{idx}"):
st.session_state['selected_conversation'] = idx
st.session_state['current_conversation'] = st.session_state.conversations[idx]
st.session_state['current_conversation'] = conversation

if st.session_state['selected_conversation'] is not None:
conversation_to_display = st.session_state.conversations[st.session_state['selected_conversation']]
Expand All @@ -115,4 +115,4 @@ def exit_handler():
if conversation_to_display['generated_responses']:
for i in range(len(conversation_to_display['generated_responses']) - 1, -1, -1):
message(conversation_to_display["generated_responses"][i], key=f"display_generated_{i}")
message(conversation_to_display['user_inputs'][i], is_user=True, key=f"display_user_{i}")
message(conversation_to_display['user_inputs'][i], is_user=True, key=f"display_user_{i}")

0 comments on commit 2140fc8

Please sign in to comment.