NavyDevilDoc commited on
Commit
37a2f8f
Β·
verified Β·
1 Parent(s): 7841205

Update src/app.py

Browse files
Files changed (1) hide show
  1. src/app.py +7 -5
src/app.py CHANGED
@@ -275,7 +275,7 @@ with tab2:
275
 
276
  c1, c2 = st.columns([1,1])
277
  with c1:
278
- use_rag = st.toggle("πŸ”Œ Enable Knowledge Base", value=True)
279
  with c2:
280
  est_tokens = len(user_input) / 4
281
  st.progress(min(est_tokens / 2000, 1.0), text=f"Input: {int(est_tokens)} tokens")
@@ -419,14 +419,16 @@ with tab4:
419
  st.markdown(f"**Total Documents:** {len(docs)}")
420
 
421
  for doc in docs:
422
- c1, c2, c3 = st.columns([3, 1, 1])
423
  with c1:
424
  st.text(f"πŸ“„ {doc['filename']}")
425
  with c2:
426
- st.caption(f"{doc['chunks']} chunks")
 
427
  with c3:
428
- # Allow ANY user to delete their OWN documents
429
- if st.button("πŸ—‘οΈ Delete", key=doc['source']):
 
430
  with st.spinner("Deleting..."):
431
  success, msg = rag_engine.delete_document(st.session_state.username, doc['source'])
432
  if success:
 
275
 
276
  c1, c2 = st.columns([1,1])
277
  with c1:
278
+ use_rag = st.toggle("πŸ”Œ Enable Knowledge Base", value=False)
279
  with c2:
280
  est_tokens = len(user_input) / 4
281
  st.progress(min(est_tokens / 2000, 1.0), text=f"Input: {int(est_tokens)} tokens")
 
419
  st.markdown(f"**Total Documents:** {len(docs)}")
420
 
421
  for doc in docs:
422
+ c1, c2, c3, c4 = st.columns([3, 2, 1, 1])
423
  with c1:
424
  st.text(f"πŸ“„ {doc['filename']}")
425
  with c2:
426
+ # FIX: Show strategy
427
+ st.caption(f"βš™οΈ {doc.get('strategy', 'Unknown')}")
428
  with c3:
429
+ st.caption(f"{doc['chunks']}")
430
+ with c4:
431
+ if st.button("πŸ—‘οΈ", key=doc['source'], help="Delete Document"):
432
  with st.spinner("Deleting..."):
433
  success, msg = rag_engine.delete_document(st.session_state.username, doc['source'])
434
  if success: