Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,58 +10,35 @@ from components.upload import handle_document_upload
|
|
| 10 |
from config.settings import APP_SETTINGS
|
| 11 |
|
| 12 |
def main():
|
| 13 |
-
|
| 14 |
-
st.
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
# Main title and description
|
| 24 |
-
st.title(APP_SETTINGS['title'])
|
| 25 |
-
st.markdown(
|
| 26 |
-
f"""
|
| 27 |
-
<p style='color: #1E3A8A;'>
|
| 28 |
-
{APP_SETTINGS['description']}
|
| 29 |
-
</p>
|
| 30 |
-
""",
|
| 31 |
-
unsafe_allow_html=True
|
| 32 |
)
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
|
| 36 |
-
if conn is None:
|
| 37 |
-
st.error("Error! Cannot create the database connection.")
|
| 38 |
-
return
|
| 39 |
-
|
| 40 |
-
backend.create_tables(conn)
|
| 41 |
-
|
| 42 |
-
# Create two columns for layout
|
| 43 |
-
col1, col2 = st.columns([1, 2])
|
| 44 |
-
|
| 45 |
-
with col1:
|
| 46 |
-
# Document upload and knowledge base
|
| 47 |
-
handle_document_upload(conn, backend)
|
| 48 |
-
display_knowledge_base(conn, backend)
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
2. Select the documents you want to analyze from the knowledge base
|
| 62 |
-
3. Click "Start New Chat" to begin asking questions
|
| 63 |
-
"""
|
| 64 |
-
)
|
| 65 |
|
| 66 |
if __name__ == "__main__":
|
| 67 |
main()
|
|
|
|
| 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.")
|
| 15 |
+
|
| 16 |
+
# Document Upload Section
|
| 17 |
+
st.header("📄 Upload Documents", anchor=False)
|
| 18 |
+
uploaded_files = st.file_uploader(
|
| 19 |
+
"Upload PDF documents",
|
| 20 |
+
type=['pdf'],
|
| 21 |
+
accept_multiple_files=True,
|
| 22 |
+
help="Limit 200MB per file • PDF"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
)
|
| 24 |
+
|
| 25 |
+
# Knowledge Base Section
|
| 26 |
+
st.header("📚 Knowledge Base", anchor=False)
|
| 27 |
|
| 28 |
+
# Display vector store information
|
| 29 |
+
display_vector_store_info()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
# Display available documents if any are uploaded
|
| 32 |
+
if uploaded_files:
|
| 33 |
+
st.subheader("Available Documents")
|
| 34 |
+
for doc in uploaded_files:
|
| 35 |
+
st.write(f"• {doc.name}")
|
| 36 |
+
|
| 37 |
+
# Chat Interface
|
| 38 |
+
if st.session_state.get('vector_store'):
|
| 39 |
+
display_chat_interface()
|
| 40 |
+
else:
|
| 41 |
+
st.info("📝 Please upload documents first.")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
if __name__ == "__main__":
|
| 44 |
main()
|