cryogenic22 commited on
Commit
c235b20
Β·
verified Β·
1 Parent(s): 374755a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +124 -0
app.py ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from pathlib import Path
3
+ import os
4
+ from utils.secrets import get_secrets_manager
5
+ from utils.persistence import get_persistent_store
6
+
7
+ def initialize_storage():
8
+ """Initialize required storage directories"""
9
+ directories = [
10
+ "data",
11
+ "data/uploads",
12
+ "data/vector_stores",
13
+ "data/workflows",
14
+ "data/prompts",
15
+ "data/cache"
16
+ ]
17
+ for dir_path in directories:
18
+ Path(dir_path).mkdir(parents=True, exist_ok=True)
19
+
20
+ def render_landing_page():
21
+ """Render main landing page"""
22
+ st.title("Lattice AI Platform")
23
+
24
+ # Platform description
25
+ st.markdown("""
26
+ Welcome to Lattice, an AI Development Platform that enables quick creation of enterprise-ready AI applications.
27
+
28
+ ### Available Components:
29
+ - πŸ“„ Document Processing
30
+ - πŸ” RAG Engine
31
+ - πŸ€– Agent System
32
+ - πŸ“š Prompt Management
33
+ - 🌐 Domain Layer
34
+ """)
35
+
36
+ # Solutions section
37
+ st.header("Solutions")
38
+
39
+ col1, col2, col3 = st.columns(3)
40
+
41
+ with col1:
42
+ st.info("### Comply.ai")
43
+ st.write("Compliance analysis and management solution")
44
+ if st.button("Launch Comply.ai"):
45
+ st.switch_page("solutions/comply_ai/app.py")
46
+
47
+ with col2:
48
+ st.info("### Contract.ai")
49
+ st.write("Contract analysis solution (Coming soon)")
50
+ st.button("Launch Contract.ai", disabled=True)
51
+
52
+ with col3:
53
+ st.info("### Policy.ai")
54
+ st.write("Policy management solution (Coming soon)")
55
+ st.button("Launch Policy.ai", disabled=True)
56
+
57
+ def render_platform_config():
58
+ """Render platform configuration section"""
59
+ st.header("Platform Configuration")
60
+
61
+ col1, col2 = st.columns(2)
62
+
63
+ with col1:
64
+ if st.button("πŸ”§ Configure Lattice"):
65
+ st.switch_page("pages/1_πŸ”§_lattice_config.py")
66
+
67
+ with col2:
68
+ if st.button("πŸ“Š Platform Status"):
69
+ st.switch_page("pages/2_πŸ“Š_platform_status.py")
70
+
71
+ def main():
72
+ # Page config
73
+ st.set_page_config(
74
+ page_title="Lattice AI Platform",
75
+ page_icon="πŸ”²",
76
+ layout="wide"
77
+ )
78
+
79
+ # Initialize storage
80
+ initialize_storage()
81
+
82
+ # Check API keys and secrets
83
+ secrets_manager = get_secrets_manager()
84
+ missing_secrets = secrets_manager.check_required_secrets()
85
+
86
+ if missing_secrets:
87
+ st.error("⚠️ Missing required API keys!")
88
+ st.info("""
89
+ Please configure the following API keys in your HuggingFace Space settings:
90
+ """)
91
+ for key in missing_secrets:
92
+ st.code(f"{key}=your-api-key-here")
93
+
94
+ # Show configuration button
95
+ if st.button("Configure Platform"):
96
+ st.switch_page("pages/1_πŸ”§_lattice_config.py")
97
+ return
98
+
99
+ # Render sidebar status
100
+ with st.sidebar:
101
+ secrets_manager.render_secrets_status()
102
+
103
+ st.divider()
104
+
105
+ # Platform version
106
+ st.caption("Lattice v0.1.0")
107
+
108
+ # Quick navigation
109
+ st.subheader("Quick Links")
110
+ if st.button("Documentation"):
111
+ st.markdown("[View Documentation](https://github.com/yourusername/lattice)")
112
+
113
+ if st.button("Report Issue"):
114
+ st.markdown("[Report Issue](https://github.com/yourusername/lattice/issues)")
115
+
116
+ # Render main content
117
+ render_landing_page()
118
+
119
+ st.divider()
120
+
121
+ render_platform_config()
122
+
123
+ if __name__ == "__main__":
124
+ main()