cryogenic22 commited on
Commit
4a46b8c
Β·
verified Β·
1 Parent(s): c391ea2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +43 -13
app.py CHANGED
@@ -19,18 +19,7 @@ st.set_page_config(
19
 
20
 
21
  def main():
22
- # Sidebar navigation
23
- st.sidebar.title("SuoMoto.AI βš–οΈ")
24
- st.sidebar.markdown(
25
- """
26
- Streamline legal workflows with advanced AI-powered tools for document management, chat, and template generation.
27
- """
28
- )
29
- tab = st.sidebar.radio(
30
- "Navigation",
31
- ["πŸ“ Case Manager", "πŸ“„ Document Manager", "πŸ€– Chat", "πŸ“ Generate Templates"]
32
- )
33
-
34
  st.markdown(
35
  """
36
  <style>
@@ -60,6 +49,18 @@ def main():
60
  unsafe_allow_html=True
61
  )
62
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  # Tab 1: Case Manager
64
  if tab == "πŸ“ Case Manager":
65
  st.title("πŸ“ Manage Cases")
@@ -154,4 +155,33 @@ def main():
154
  with st.spinner("Generating response..."):
155
  context = selected_document['text']
156
  response = vector_store.chat_with_context(query, context)
157
- st.markdow
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
 
21
  def main():
22
+ # Header (placed at the start of the app)
 
 
 
 
 
 
 
 
 
 
 
23
  st.markdown(
24
  """
25
  <style>
 
49
  unsafe_allow_html=True
50
  )
51
 
52
+ # Sidebar navigation
53
+ st.sidebar.title("SuoMoto.AI βš–οΈ")
54
+ st.sidebar.markdown(
55
+ """
56
+ Streamline legal workflows with advanced AI-powered tools for document management, chat, and template generation.
57
+ """
58
+ )
59
+ tab = st.sidebar.radio(
60
+ "Navigation",
61
+ ["πŸ“ Case Manager", "πŸ“„ Document Manager", "πŸ€– Chat", "πŸ“ Generate Templates"]
62
+ )
63
+
64
  # Tab 1: Case Manager
65
  if tab == "πŸ“ Case Manager":
66
  st.title("πŸ“ Manage Cases")
 
155
  with st.spinner("Generating response..."):
156
  context = selected_document['text']
157
  response = vector_store.chat_with_context(query, context)
158
+ st.markdown(f"**Response**: {response}")
159
+
160
+ # Allow adding new documents mid-chat
161
+ uploaded_file = st.file_uploader("πŸ“‚ Upload Document During Chat", key="chat_upload")
162
+ if uploaded_file:
163
+ with st.spinner("Processing document..."):
164
+ text, chunks, metadata = doc_processor.process_and_tag_document(uploaded_file)
165
+ doc_data = {"title": uploaded_file.name, "text": text, "metadata": metadata}
166
+ case_manager.add_document(selected_case, doc_data)
167
+ st.success(f"Document '{uploaded_file.name}' added to case!")
168
+
169
+ # Tab 4: Generate Templates
170
+ elif tab == "πŸ“ Generate Templates":
171
+ st.title("πŸ“ Legal Document Templates")
172
+ st.markdown("Generate standard legal documents using predefined templates.")
173
+ render_template_generator()
174
+
175
+ # Footer
176
+ st.markdown(
177
+ """
178
+ <div class="footer">
179
+ Synaptyx: SuoMoto.AI agent
180
+ </div>
181
+ """,
182
+ unsafe_allow_html=True
183
+ )
184
+
185
+
186
+ if __name__ == "__main__":
187
+ main()