cryogenic22 commited on
Commit
56b316d
·
verified ·
1 Parent(s): 72c7471

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -49
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
- # Page configuration
14
- st.set_page_config(
15
- page_title=APP_SETTINGS['title'],
16
- page_icon=APP_SETTINGS['icon'],
17
- layout=APP_SETTINGS['layout']
18
- )
19
-
20
- # Initialize session state
21
- initialize_session_state()
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
- # Database initialization
35
- conn = backend.create_connection(APP_SETTINGS['database'])
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
- with col2:
51
- # Chat interface or welcome message
52
- if st.session_state.current_chat and st.session_state.qa_system:
53
- display_chat_interface()
54
- else:
55
- st.markdown(
56
- """
57
- ### 👋 Welcome to SYNAPTYX!
58
-
59
- To get started:
60
- 1. Upload your RFP documents using the upload section
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()