Update app.py
Browse files
app.py
CHANGED
@@ -308,11 +308,11 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="AI Syllabus Archit
|
|
308 |
# --- TOP LEVEL HEADER (Collapsible) ---
|
309 |
with gr.Column(visible=True) as header_view:
|
310 |
gr.Markdown(
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
)
|
317 |
toggle_header_btn = gr.Button("⬆️", elem_classes="sm-button")
|
318 |
|
@@ -330,9 +330,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="AI Syllabus Archit
|
|
330 |
# ===================================================================
|
331 |
with gr.Tabs(elem_id="app-tabs", visible=(APP_MODE == 'admin')) as app_tabs:
|
332 |
|
333 |
-
# --- TAB 1: The Main Chat Interface ---
|
334 |
-
# --- TAB 1: The Main Chat Interface ---
|
335 |
-
# --- TAB 1: The Main Chat Interface ---
|
336 |
with gr.Tab("Chat Interface", id="chat_tab"):
|
337 |
with gr.Row(equal_height=False):
|
338 |
|
@@ -362,7 +359,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="AI Syllabus Archit
|
|
362 |
|
363 |
# --- TOOLS SIDEBAR COLUMN (Correctly nested inside the Chat Tab's Row) ---
|
364 |
with gr.Column(scale=3, visible=True) as tools_sidebar:
|
365 |
-
close_sidebar_btn = gr.Button("
|
366 |
with gr.Accordion("🛠️ Session Content", open=True):
|
367 |
gr.Markdown("### 📄 Resources")
|
368 |
file_uploader = gr.File(label="Upload Learning Materials (First Turn Only)", file_count="multiple", file_types=[".pdf", ".docx", ".txt"], interactive=True)
|
@@ -421,7 +418,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="AI Syllabus Archit
|
|
421 |
* **Key Figures from History:** To get a unique and powerful perspective.
|
422 |
* *Prompt Example:* `"Teach me chess as if you are Bobby Fischer preparing me for a world championship. Your tone should be intense, obsessive, and focused on total dominance. We will analyze unorthodox openings, drill methods to exploit opponent weaknesses, and master endgame precision. Every lesson is a step toward crushing the competition."`
|
423 |
|
424 |
-
|
425 |
"""
|
426 |
)
|
427 |
|
@@ -480,4 +477,5 @@ if __name__ == "__main__":
|
|
480 |
logger.critical("FATAL: Could not initialize DSPy or orchestrator modules in Admin mode.")
|
481 |
else:
|
482 |
logger.info("Starting in VISITOR mode. Waiting for user to provide API key.")
|
483 |
-
demo.queue().launch(debug=True)
|
|
|
|
308 |
# --- TOP LEVEL HEADER (Collapsible) ---
|
309 |
with gr.Column(visible=True) as header_view:
|
310 |
gr.Markdown(
|
311 |
+
"""
|
312 |
+
# AI Tutor & Syllabus Planner
|
313 |
+
Upload a resource or ask what you want to learn to generate a syllabus. Finalize the plan, then tell the AI how you want to be taught. The tutor will then explain the topics based on your persona.
|
314 |
+
""",
|
315 |
+
elem_id="app-header"
|
316 |
)
|
317 |
toggle_header_btn = gr.Button("⬆️", elem_classes="sm-button")
|
318 |
|
|
|
330 |
# ===================================================================
|
331 |
with gr.Tabs(elem_id="app-tabs", visible=(APP_MODE == 'admin')) as app_tabs:
|
332 |
|
|
|
|
|
|
|
333 |
with gr.Tab("Chat Interface", id="chat_tab"):
|
334 |
with gr.Row(equal_height=False):
|
335 |
|
|
|
359 |
|
360 |
# --- TOOLS SIDEBAR COLUMN (Correctly nested inside the Chat Tab's Row) ---
|
361 |
with gr.Column(scale=3, visible=True) as tools_sidebar:
|
362 |
+
close_sidebar_btn = gr.Button("Close Sidebar ➡️", elem_classes="sm-button")
|
363 |
with gr.Accordion("🛠️ Session Content", open=True):
|
364 |
gr.Markdown("### 📄 Resources")
|
365 |
file_uploader = gr.File(label="Upload Learning Materials (First Turn Only)", file_count="multiple", file_types=[".pdf", ".docx", ".txt"], interactive=True)
|
|
|
418 |
* **Key Figures from History:** To get a unique and powerful perspective.
|
419 |
* *Prompt Example:* `"Teach me chess as if you are Bobby Fischer preparing me for a world championship. Your tone should be intense, obsessive, and focused on total dominance. We will analyze unorthodox openings, drill methods to exploit opponent weaknesses, and master endgame precision. Every lesson is a step toward crushing the competition."`
|
420 |
|
421 |
+
**"After finalizing your perfected syllabus, you will be asked a persona question by the AI. Answer it based on that persona to begin your advanced learning session."**.
|
422 |
"""
|
423 |
)
|
424 |
|
|
|
477 |
logger.critical("FATAL: Could not initialize DSPy or orchestrator modules in Admin mode.")
|
478 |
else:
|
479 |
logger.info("Starting in VISITOR mode. Waiting for user to provide API key.")
|
480 |
+
demo.queue().launch(debug=True)
|
481 |
+
|