bohmian commited on
Commit
399efe8
1 Parent(s): 6811f8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -349,16 +349,14 @@ if "menu" not in st.session_state:
349
 
350
  # sidebar with menu navigation
351
  with st.sidebar:
352
- st.subheader("DO NOT NAVIGATE between pages when agent is still generating messages in the chat. Wait for query to complete first.\n")
353
- selected = option_menu("Main Menu", st.session_state["menu"],
 
354
  icons=['house', 'gear', 'gear', 'gear'], menu_icon="cast", default_index=0)
355
  st.spinner("test")
356
-
357
 
358
- col1, col2 = st.columns(2)
359
- # with col1:
360
 
361
- if selected == "Chatbot":
362
  st.header("Chat")
363
 
364
  # Store the conversation in the session state.
@@ -432,16 +430,20 @@ if selected == "Chatbot":
432
  st.markdown(response)
433
 
434
 
435
- # with col2:
436
- # st.write("hi")
 
 
 
 
437
 
438
 
439
- if selected == "Source Documents for Last Query":
440
- st.header("Source Documents for Last Query")
441
  try:
442
  st.subheader(st.session_state['source_documents'][0])
443
  for doc in st.session_state['source_documents'][1:]:
444
  st.write("Source: " + doc.metadata['source'])
445
  st.write(doc)
446
  except:
447
- st.write("No source documents retrieved yet. Please run a user query before coming back to this page.")
 
349
 
350
  # sidebar with menu navigation
351
  with st.sidebar:
352
+ st.subheader("DO NOT NAVIGATE between pages when agent is still generating messages in the chat. Wait for query to complete first.")
353
+ st.write("")
354
+ page = option_menu("Main Menu", st.session_state["menu"],
355
  icons=['house', 'gear', 'gear', 'gear'], menu_icon="cast", default_index=0)
356
  st.spinner("test")
 
357
 
 
 
358
 
359
+ if page == "Chatbot":
360
  st.header("Chat")
361
 
362
  # Store the conversation in the session state.
 
430
  st.markdown(response)
431
 
432
 
433
+ if page == "Chat Config":
434
+ st.header(page)
435
+
436
+
437
+ if page == "Document, Retriever, Web Scraping Config":
438
+ st.header(page)
439
 
440
 
441
+ if page == "Source Documents for Last Query":
442
+ st.header(page)
443
  try:
444
  st.subheader(st.session_state['source_documents'][0])
445
  for doc in st.session_state['source_documents'][1:]:
446
  st.write("Source: " + doc.metadata['source'])
447
  st.write(doc)
448
  except:
449
+ st.write("No source documents retrieved yet. Please run a user query before coming back to this page.")