Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -121,7 +121,7 @@ def admin_copilot_generator(template_id: str, topic: str, date: str, location: s
|
|
| 121 |
except (KeyError, json.JSONDecodeError) as e:
|
| 122 |
return f"ERROR: Failed to parse LLM structured output. {e}"
|
| 123 |
|
| 124 |
-
# --- Module B: Teaching AI Designer (
|
| 125 |
|
| 126 |
def lesson_plan_designer(grade: str, subject: str, topic: str, hours: float, method: str, equipment: str, class_needs: str) -> str:
|
| 127 |
"""
|
|
@@ -141,7 +141,7 @@ def lesson_plan_designer(grade: str, subject: str, topic: str, hours: float, met
|
|
| 141 |
# System Prompt defined for the Teaching Designer
|
| 142 |
system_prompt = (
|
| 143 |
"角色:台灣國高中資深教師與課程設計師\n"
|
| 144 |
-
"輸出:JSON
|
| 145 |
"限制:活動分鏡以 15 分鐘粒度;至少 2 項形成性評量。\n"
|
| 146 |
"對齊:請將輸出中的 'curriculum_alignment' 欄位,對齊台灣課綱的關鍵能力/素養。"
|
| 147 |
)
|
|
@@ -196,12 +196,13 @@ lesson_plan_designer_interface = gr.Interface(
|
|
| 196 |
gr.Textbox(label="學科 (Subject)", value="歷史"),
|
| 197 |
gr.Textbox(label="單元主題 (Unit Topic)", value="從茶葉看全球化:17-19世紀的貿易網絡"),
|
| 198 |
gr.Slider(label="課時數 (Number of Sessions)", minimum=1, maximum=10, step=1, value=4),
|
| 199 |
-
|
|
|
|
| 200 |
gr.Textbox(label="可用設備 (Available Equipment)", value="平板電腦、投影設備、網路"),
|
| 201 |
gr.Textbox(label="班級特性 (Class Characteristics)", value="班級組成多元,需考慮多樣化的史料呈現方式。"),
|
| 202 |
],
|
| 203 |
-
outputs=gr.JSON(label="AI
|
| 204 |
-
title="教學 AI 設計器:教案與 Rubric 生成 (Teaching AI Designer: Lesson Plan &
|
| 205 |
description="📘 生成符合課綱精神的單元教案結構和評量規準 JSON。",
|
| 206 |
flagging_mode="never", # Updated from allow_flagging
|
| 207 |
)
|
|
|
|
| 121 |
except (KeyError, json.JSONDecodeError) as e:
|
| 122 |
return f"ERROR: Failed to parse LLM structured output. {e}"
|
| 123 |
|
| 124 |
+
# --- Module B: Teaching AI Designer (Gradio Wrapper) ---
|
| 125 |
|
| 126 |
def lesson_plan_designer(grade: str, subject: str, topic: str, hours: float, method: str, equipment: str, class_needs: str) -> str:
|
| 127 |
"""
|
|
|
|
| 141 |
# System Prompt defined for the Teaching Designer
|
| 142 |
system_prompt = (
|
| 143 |
"角色:台灣國高中資深教師與課程設計師\n"
|
| 144 |
+
"輸出:JSON(教案標題、目標、課綱對齊、活動步驟、評量規準、差異化建議)\n"
|
| 145 |
"限制:活動分鏡以 15 分鐘粒度;至少 2 項形成性評量。\n"
|
| 146 |
"對齊:請將輸出中的 'curriculum_alignment' 欄位,對齊台灣課綱的關鍵能力/素養。"
|
| 147 |
)
|
|
|
|
| 196 |
gr.Textbox(label="學科 (Subject)", value="歷史"),
|
| 197 |
gr.Textbox(label="單元主題 (Unit Topic)", value="從茶葉看全球化:17-19世紀的貿易網絡"),
|
| 198 |
gr.Slider(label="課時數 (Number of Sessions)", minimum=1, maximum=10, step=1, value=4),
|
| 199 |
+
# FIXED: Corrected the syntax error on the next line
|
| 200 |
+
gr.Dropdown(label="教學法偏好 (Pedagogy Preference)", choices=["探究式、PBL", "翻轉教學", "合作學習", "講述法"], value="探究式、PBL"),
|
| 201 |
gr.Textbox(label="可用設備 (Available Equipment)", value="平板電腦、投影設備、網路"),
|
| 202 |
gr.Textbox(label="班級特性 (Class Characteristics)", value="班級組成多元,需考慮多樣化的史料呈現方式。"),
|
| 203 |
],
|
| 204 |
+
outputs=gr.JSON(label="AI 生成教案與評量規V JSON (Lesson Plan & Rubric JSON)"),
|
| 205 |
+
title="教學 AI 設計器:教案與 Rubric 生成 (Teaching AI Designer: Lesson Plan & Rubric)",
|
| 206 |
description="📘 生成符合課綱精神的單元教案結構和評量規準 JSON。",
|
| 207 |
flagging_mode="never", # Updated from allow_flagging
|
| 208 |
)
|