Update app.py
Browse files
app.py
CHANGED
|
@@ -4,11 +4,12 @@ import backend
|
|
| 4 |
from utils.session_state import initialize_session_state
|
| 5 |
from utils.database import get_documents, insert_document
|
| 6 |
from components.chat import display_chat_interface
|
| 7 |
-
from utils.database import display_vector_store_info
|
| 8 |
from components.knowledge_base import display_knowledge_base
|
| 9 |
from components.upload import handle_document_upload
|
| 10 |
from config.settings import APP_SETTINGS
|
| 11 |
|
|
|
|
| 12 |
def main():
|
| 13 |
st.title("🤖 SYNAPTYX - RFP Analysis Agent")
|
| 14 |
st.markdown("Upload RFP documents, analyze requirements, and get intelligent answers powered by AI.")
|
|
@@ -22,6 +23,14 @@ def main():
|
|
| 22 |
help="Limit 200MB per file • PDF"
|
| 23 |
)
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Knowledge Base Section
|
| 26 |
st.header("📚 Knowledge Base", anchor=False)
|
| 27 |
|
|
|
|
| 4 |
from utils.session_state import initialize_session_state
|
| 5 |
from utils.database import get_documents, insert_document
|
| 6 |
from components.chat import display_chat_interface
|
| 7 |
+
from utils.database import display_vector_store_info, handle_document_upload
|
| 8 |
from components.knowledge_base import display_knowledge_base
|
| 9 |
from components.upload import handle_document_upload
|
| 10 |
from config.settings import APP_SETTINGS
|
| 11 |
|
| 12 |
+
|
| 13 |
def main():
|
| 14 |
st.title("🤖 SYNAPTYX - RFP Analysis Agent")
|
| 15 |
st.markdown("Upload RFP documents, analyze requirements, and get intelligent answers powered by AI.")
|
|
|
|
| 23 |
help="Limit 200MB per file • PDF"
|
| 24 |
)
|
| 25 |
|
| 26 |
+
# Handle document upload when files are uploaded
|
| 27 |
+
if uploaded_files:
|
| 28 |
+
# Only process if files haven't been processed yet
|
| 29 |
+
if 'processed_files' not in st.session_state or uploaded_files != st.session_state.processed_files:
|
| 30 |
+
handle_document_upload(uploaded_files)
|
| 31 |
+
# Store the processed files to avoid reprocessing
|
| 32 |
+
st.session_state.processed_files = uploaded_files
|
| 33 |
+
|
| 34 |
# Knowledge Base Section
|
| 35 |
st.header("📚 Knowledge Base", anchor=False)
|
| 36 |
|