Spaces:
Build error
Build error
Download components/document_store.py from cryogenic22/RFP_Analyzer_Agent: direct link, hf CLI and curl.
- Browser
- Download file 991 Bytes
-
https://huggingface.co/spaces/cryogenic22/RFP_Analyzer_Agent/resolve/main/components/document_store.py
- Command line
-
hf download hf://spaces/cryogenic22/RFP_Analyzer_Agent/components/document_store.py
-
curl -L -o document_store.py https://huggingface.co/spaces/cryogenic22/RFP_Analyzer_Agent/resolve/main/components/document_store.py
991 Bytes
| # components/document_store.py | |
| import streamlit as st | |
| from typing import Dict, List, Optional | |
| from utils.database import ( | |
| get_all_documents, | |
| get_collections, | |
| get_collection_documents, | |
| create_collection, | |
| add_document_to_collection, | |
| remove_from_collection, | |
| search_documents | |
| ) | |
| def display_documents_tab(): | |
| col1, col2 = st.columns([1, 2]) | |
| with col1: | |
| st.header("Collections") | |
| # Create new collection | |
| st.subheader("Create New Collection") | |
| col_name = st.text_input("Collection Name", key="doc_store_collection_name") | |
| col_desc = st.text_area("Description", height=100, key="doc_store_collection_desc") | |
| if st.button("Create Collection", use_container_width=True, key="doc_store_create_btn"): | |
| if col_name: | |
| if create_collection(st.session_state.db_conn, col_name, col_desc): | |
| st.success(f"Collection '{col_name}' created!") | |
| st.rerun() |