Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
"""
|
| 2 |
LifeAdmin AI - Main Gradio Application
|
| 3 |
Hackathon Project: Track 2 - MCP in Action
|
|
|
|
| 4 |
"""
|
| 5 |
|
| 6 |
import gradio as gr
|
|
@@ -14,6 +15,7 @@ load_dotenv()
|
|
| 14 |
|
| 15 |
from ui.manual_dashboard import create_manual_dashboard
|
| 16 |
from ui.voice_agent_ui import create_voice_agent_ui
|
|
|
|
| 17 |
from agent.agent_core import LifeAdminAgent
|
| 18 |
from utils.llm_utils import setup_llm_fallback
|
| 19 |
|
|
@@ -27,17 +29,15 @@ agent = LifeAdminAgent()
|
|
| 27 |
print("β Agent initialized successfully!")
|
| 28 |
|
| 29 |
# -------------------------------------------
|
| 30 |
-
# CUSTOM CSS
|
| 31 |
# -------------------------------------------
|
| 32 |
custom_css = """
|
| 33 |
<style>
|
| 34 |
-
|
| 35 |
/* Main container styling */
|
| 36 |
.gradio-container {
|
| 37 |
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
| 38 |
max-width: 1400px !important;
|
| 39 |
}
|
| 40 |
-
|
| 41 |
/* Header styling */
|
| 42 |
.header-container {
|
| 43 |
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
@@ -52,29 +52,25 @@ custom_css = """
|
|
| 52 |
font-size: 2.5rem;
|
| 53 |
font-weight: 700;
|
| 54 |
}
|
| 55 |
-
|
| 56 |
.tool-card:hover {
|
| 57 |
border-color: #667eea;
|
| 58 |
transform: translateY(-2px);
|
| 59 |
}
|
| 60 |
-
|
| 61 |
.primary-button {
|
| 62 |
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
| 63 |
color: white !important;
|
| 64 |
}
|
| 65 |
-
|
| 66 |
.footer {
|
| 67 |
text-align: center;
|
| 68 |
margin-top: 3rem;
|
| 69 |
padding: 1.5rem;
|
| 70 |
color: #718096;
|
| 71 |
}
|
| 72 |
-
|
| 73 |
</style>
|
| 74 |
"""
|
| 75 |
|
| 76 |
# ---------------------------------------------------------
|
| 77 |
-
# Create Gradio App
|
| 78 |
# ---------------------------------------------------------
|
| 79 |
def create_app():
|
| 80 |
app = gr.Blocks(
|
|
@@ -102,6 +98,11 @@ def create_app():
|
|
| 102 |
gr.Markdown("### π― Manual Mode β Full Control Over Tools")
|
| 103 |
create_manual_dashboard(agent)
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
# Voice Agent
|
| 106 |
with gr.Tab("π€ Voice Agent"):
|
| 107 |
gr.Markdown("### π€ Voice Agent β Speak Commands, Agent Executes")
|
|
@@ -144,9 +145,8 @@ if __name__ == "__main__":
|
|
| 144 |
print("\nβ
LifeAdmin AI is ready!")
|
| 145 |
print("π± Open: http://localhost:7860")
|
| 146 |
|
| 147 |
-
# β FIX: Removed invalid argument show_api
|
| 148 |
app.launch(
|
| 149 |
server_name="0.0.0.0",
|
| 150 |
server_port=int(os.getenv("GRADIO_SERVER_PORT", 7860)),
|
| 151 |
show_error=True
|
| 152 |
-
)
|
|
|
|
| 1 |
"""
|
| 2 |
LifeAdmin AI - Main Gradio Application
|
| 3 |
Hackathon Project: Track 2 - MCP in Action
|
| 4 |
+
Updated with LifeAdmin Coach chatbot tab
|
| 5 |
"""
|
| 6 |
|
| 7 |
import gradio as gr
|
|
|
|
| 15 |
|
| 16 |
from ui.manual_dashboard import create_manual_dashboard
|
| 17 |
from ui.voice_agent_ui import create_voice_agent_ui
|
| 18 |
+
from ui.lifeadmin_coach_ui import create_lifeadmin_coach_ui
|
| 19 |
from agent.agent_core import LifeAdminAgent
|
| 20 |
from utils.llm_utils import setup_llm_fallback
|
| 21 |
|
|
|
|
| 29 |
print("β Agent initialized successfully!")
|
| 30 |
|
| 31 |
# -------------------------------------------
|
| 32 |
+
# CUSTOM CSS
|
| 33 |
# -------------------------------------------
|
| 34 |
custom_css = """
|
| 35 |
<style>
|
|
|
|
| 36 |
/* Main container styling */
|
| 37 |
.gradio-container {
|
| 38 |
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
| 39 |
max-width: 1400px !important;
|
| 40 |
}
|
|
|
|
| 41 |
/* Header styling */
|
| 42 |
.header-container {
|
| 43 |
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
| 52 |
font-size: 2.5rem;
|
| 53 |
font-weight: 700;
|
| 54 |
}
|
|
|
|
| 55 |
.tool-card:hover {
|
| 56 |
border-color: #667eea;
|
| 57 |
transform: translateY(-2px);
|
| 58 |
}
|
|
|
|
| 59 |
.primary-button {
|
| 60 |
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
| 61 |
color: white !important;
|
| 62 |
}
|
|
|
|
| 63 |
.footer {
|
| 64 |
text-align: center;
|
| 65 |
margin-top: 3rem;
|
| 66 |
padding: 1.5rem;
|
| 67 |
color: #718096;
|
| 68 |
}
|
|
|
|
| 69 |
</style>
|
| 70 |
"""
|
| 71 |
|
| 72 |
# ---------------------------------------------------------
|
| 73 |
+
# Create Gradio App
|
| 74 |
# ---------------------------------------------------------
|
| 75 |
def create_app():
|
| 76 |
app = gr.Blocks(
|
|
|
|
| 98 |
gr.Markdown("### π― Manual Mode β Full Control Over Tools")
|
| 99 |
create_manual_dashboard(agent)
|
| 100 |
|
| 101 |
+
# LifeAdmin Coach (NEW!)
|
| 102 |
+
with gr.Tab("π¬ LifeAdmin Coach"):
|
| 103 |
+
gr.Markdown("### π€ AI Assistant β Chat About Your Documents & Tasks")
|
| 104 |
+
create_lifeadmin_coach_ui(agent)
|
| 105 |
+
|
| 106 |
# Voice Agent
|
| 107 |
with gr.Tab("π€ Voice Agent"):
|
| 108 |
gr.Markdown("### π€ Voice Agent β Speak Commands, Agent Executes")
|
|
|
|
| 145 |
print("\nβ
LifeAdmin AI is ready!")
|
| 146 |
print("π± Open: http://localhost:7860")
|
| 147 |
|
|
|
|
| 148 |
app.launch(
|
| 149 |
server_name="0.0.0.0",
|
| 150 |
server_port=int(os.getenv("GRADIO_SERVER_PORT", 7860)),
|
| 151 |
show_error=True
|
| 152 |
+
)
|