Wajahat698 commited on
Commit
1e3da4b
·
verified ·
1 Parent(s): 3ddad27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -679,7 +679,7 @@ def side():
679
  md_contents = [convert_file_to_md(file) for file in uploaded_files if convert_file_to_md(file)]
680
  if md_contents:
681
  merged_md_content = merge_markdown_contents(md_contents)
682
- upload_url = upload_to_firebase(user_id, merged_md_content)
683
  if upload_url:
684
  st.sidebar.success("Files uploaded successfully!")
685
  st.sidebar.markdown(f"[View your knowledge base here]({upload_url})", unsafe_allow_html=True)
@@ -705,7 +705,7 @@ def side():
705
  unsafe_allow_html=True
706
  )
707
 
708
- docs = fetch_documents(user_id)
709
  st.sidebar.markdown('<div class="scrollable-container">', unsafe_allow_html=True)
710
  if docs:
711
  for doc_id, doc_data in docs.items():
@@ -713,7 +713,7 @@ def side():
713
  col1, col2 = st.sidebar.columns([0.5, 0.5])
714
  with col1:
715
  if st.button("Delete", key=f"del_{doc_id}"):
716
- delete_document(user_id, doc_id)
717
  with col2:
718
  if st.button("View", key=f"view_{doc_id}"):
719
  st.sidebar.write(doc_data["content"])
@@ -752,7 +752,7 @@ def side():
752
  for idx, (bucket, label) in enumerate(zip(trust_buckets, bucket_labels)):
753
  with st.sidebar:
754
  if st.button(f"{bucket}", key=f"allocate_{label}"):
755
- save_content(user_id, trust_builder_text, label)
756
 
757
  if st.sidebar.button("Let AI allocate"):
758
  st.write("AI allocated the Trust Bucket")
 
679
  md_contents = [convert_file_to_md(file) for file in uploaded_files if convert_file_to_md(file)]
680
  if md_contents:
681
  merged_md_content = merge_markdown_contents(md_contents)
682
+ upload_url = upload_to_firebase(st.session_state["wix_user_id"], merged_md_content)
683
  if upload_url:
684
  st.sidebar.success("Files uploaded successfully!")
685
  st.sidebar.markdown(f"[View your knowledge base here]({upload_url})", unsafe_allow_html=True)
 
705
  unsafe_allow_html=True
706
  )
707
 
708
+ docs = fetch_documents(st.session_state["wix_user_id"])
709
  st.sidebar.markdown('<div class="scrollable-container">', unsafe_allow_html=True)
710
  if docs:
711
  for doc_id, doc_data in docs.items():
 
713
  col1, col2 = st.sidebar.columns([0.5, 0.5])
714
  with col1:
715
  if st.button("Delete", key=f"del_{doc_id}"):
716
+ delete_document(st.session_state["wix_user_id"], doc_id)
717
  with col2:
718
  if st.button("View", key=f"view_{doc_id}"):
719
  st.sidebar.write(doc_data["content"])
 
752
  for idx, (bucket, label) in enumerate(zip(trust_buckets, bucket_labels)):
753
  with st.sidebar:
754
  if st.button(f"{bucket}", key=f"allocate_{label}"):
755
+ save_content(st.session_state["wix_user_id"], trust_builder_text, label)
756
 
757
  if st.sidebar.button("Let AI allocate"):
758
  st.write("AI allocated the Trust Bucket")