Spaces:
Runtime error
Runtime error
Errolmking
commited on
Commit
·
97cc067
1
Parent(s):
cbcdc6e
Update app.py
Browse filesAdded UDL, cleaned up workflow, renamed Syllabo...
app.py
CHANGED
@@ -153,7 +153,7 @@ class Agent:
|
|
153 |
yield next_token, content
|
154 |
except Empty:
|
155 |
continue
|
156 |
-
|
157 |
unit_generator_prompt = """
|
158 |
Take the following class overview (delimited by three dollar signs)
|
159 |
$$$
|
@@ -165,41 +165,41 @@ unit_generator_prompt = """
|
|
165 |
Enduring Ideas: Make a list of 5 big and enduring ideas that students should walk away with.
|
166 |
Essential Questions: Make a list of 5 essential questions we want students to think about. These questions should be open-ended and provocative. Written in "kid friendly" language. Designed to focus instruction for uncovering the important ideas of the content.
|
167 |
Key Concepts: Make a list of 5 ideas, concepts, generalizations and principles we want students to know and understand about the unit or topic we are teaching?
|
|
|
168 |
Skills: Make a list of 5 critical skills describing what we want students to be able to do. Each item should begin with "Students will be able to..."
|
|
|
169 |
Assessment: Make a list of 5 example assessments we can use to give students opportunities to demonstrate their skills. Explain the assessment idea and which key concepts and skills they map to.
|
170 |
-
Different Learners: Make a list of 5 creative ways that I might adapt the experience for different learning styles. Explain the way I might adapt the experience to the learning style.
|
171 |
Character: Make a list of 5 opportunity that this unit can support the learners development towards the "portrait" of a graduate. Each opportunity should identify the trait and how it might be applied.
|
172 |
-
|
173 |
|
174 |
unit_generator = Agent(prompt_template=unit_generator_prompt)
|
175 |
|
176 |
lesson_idea_generator_prompt = """
|
177 |
-
Below is a
|
178 |
$$$
|
179 |
{input}
|
180 |
$$$
|
181 |
-
|
182 |
-
Each idea should include a title, a one sentence description of the activity, a one sentence description of how it addresses key concepts from the unit
|
183 |
-
|
184 |
|
185 |
lesson_idea_generator = Agent(prompt_template=lesson_idea_generator_prompt)
|
186 |
|
187 |
-
lesson_builder_prompt = """
|
188 |
-
The
|
189 |
-
%%% {input} %%%
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
Unit
|
200 |
-
|
201 |
-
|
202 |
-
"""
|
203 |
|
204 |
lesson_builder = Agent(prompt_template=lesson_builder_prompt)
|
205 |
|
@@ -207,12 +207,13 @@ def generate_unit(input):
|
|
207 |
for next_token, content in unit_generator.stream(input):
|
208 |
yield(content)
|
209 |
|
210 |
-
def generate_lesson_ideas(unit):
|
211 |
-
|
|
|
212 |
yield(content)
|
213 |
|
214 |
-
def generate_lesson_plan(unit,lesson_description):
|
215 |
-
input = unit + "Lesson description below (delimited by triple ampersand): @@@ " + lesson_description + " @@@"
|
216 |
for next_token, content in lesson_builder.stream(input):
|
217 |
yield(content)
|
218 |
|
@@ -221,67 +222,47 @@ app = gr.Blocks(theme=gr.themes.Soft())
|
|
221 |
with app:
|
222 |
|
223 |
gr.Markdown(
|
224 |
-
"""
|
225 |
-
#
|
226 |
-
|
227 |
-
A suite of tools for designing and building course units and lessons.
|
228 |
|
229 |
-
|
230 |
-
email: errol.m.king@gmail.com
|
231 |
|
232 |
""")
|
233 |
|
234 |
-
with gr.Tab("
|
235 |
gr.Markdown(
|
236 |
"""
|
237 |
-
|
238 |
-
The Vision to Unit tool will take an idea of a learning experience and build out a UBD unit.
|
239 |
-
|
240 |
-
Instructions:
|
241 |
-
1) Describe the learning experience. Include a few key topics, age and integrations.
|
242 |
-
2) Press the 'Generate Unit' button.
|
243 |
-
3) Review in the unit section.
|
244 |
-
4) Go to the next section.
|
245 |
""")
|
246 |
|
247 |
-
unit_vision = gr.Textbox(label="
|
248 |
-
b1 = gr.Button("
|
249 |
-
unit = gr.Textbox(label="
|
250 |
|
251 |
-
with gr.Tab("
|
252 |
gr.Markdown(
|
253 |
"""
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
2) Review the ideas.
|
260 |
-
3) Identify the one you want to expand upon. Highlight and copy to clipboard.
|
261 |
-
4) Go to the next section.
|
262 |
""")
|
263 |
-
|
264 |
-
|
|
|
265 |
|
266 |
-
with gr.Tab("Lesson
|
267 |
gr.Markdown(
|
268 |
"""
|
269 |
-
|
270 |
-
This tool takes an lesson idea and generates a complete lesson plan.
|
271 |
-
|
272 |
-
Instructions:
|
273 |
-
1) Paste one of the generated ideas ( or your own original )
|
274 |
-
2) Add additional considerations: time, number of kids, age, etc.
|
275 |
-
3) Press the 'Generate Lesson Plan' button.
|
276 |
-
4) Read the lesson plan.
|
277 |
-
5) Do it again!
|
278 |
""")
|
279 |
lesson_description = gr.Textbox(label="Input lesson idea:")
|
280 |
b3 = gr.Button("Generate Lesson Plan")
|
281 |
-
lesson_plan = gr.Textbox(label="Lesson Plan
|
282 |
|
283 |
b1.click(generate_unit, inputs=unit_vision, outputs=unit)
|
284 |
-
b2.click(generate_lesson_ideas, inputs=unit, outputs=lesson_ideas)
|
285 |
-
b3.click(generate_lesson_plan, inputs=[unit,lesson_description], outputs=lesson_plan)
|
286 |
|
287 |
-
app.queue().launch()
|
|
|
153 |
yield next_token, content
|
154 |
except Empty:
|
155 |
continue
|
156 |
+
|
157 |
unit_generator_prompt = """
|
158 |
Take the following class overview (delimited by three dollar signs)
|
159 |
$$$
|
|
|
165 |
Enduring Ideas: Make a list of 5 big and enduring ideas that students should walk away with.
|
166 |
Essential Questions: Make a list of 5 essential questions we want students to think about. These questions should be open-ended and provocative. Written in "kid friendly" language. Designed to focus instruction for uncovering the important ideas of the content.
|
167 |
Key Concepts: Make a list of 5 ideas, concepts, generalizations and principles we want students to know and understand about the unit or topic we are teaching?
|
168 |
+
Misconceptions: Make a list of 5 common misconceptions that occur when learning about this topic.
|
169 |
Skills: Make a list of 5 critical skills describing what we want students to be able to do. Each item should begin with "Students will be able to..."
|
170 |
+
Real-World Applications: Make a list of 5 ways that this skill can be used in "the real world"
|
171 |
Assessment: Make a list of 5 example assessments we can use to give students opportunities to demonstrate their skills. Explain the assessment idea and which key concepts and skills they map to.
|
172 |
+
Different Learners: Make a list of 5 creative ways that I might adapt the experience for different learning styles making it more universally accessible. Explain the way I might adapt the experience to the learning style.
|
173 |
Character: Make a list of 5 opportunity that this unit can support the learners development towards the "portrait" of a graduate. Each opportunity should identify the trait and how it might be applied.
|
174 |
+
"""
|
175 |
|
176 |
unit_generator = Agent(prompt_template=unit_generator_prompt)
|
177 |
|
178 |
lesson_idea_generator_prompt = """
|
179 |
+
Below is a curriculum unit expressed using the understanding by design methodology ( delimited by the triple dollar signs).
|
180 |
$$$
|
181 |
{input}
|
182 |
$$$
|
183 |
+
Using this unit definition and STUDENT INTERESTS generate 10 unique learning activity idea inspired by different pedagogies. ( play-based, project-based, game-based, etc.)
|
184 |
+
Each idea should include the randomly selected pedagogy, a title, a one sentence description of the activity, a one sentence description of how it addresses key concepts from the unit and one sentence explaining how it supports STUDENT INTERESTS.
|
185 |
+
"""
|
186 |
|
187 |
lesson_idea_generator = Agent(prompt_template=lesson_idea_generator_prompt)
|
188 |
|
189 |
+
lesson_builder_prompt = """
|
190 |
+
The curriculum unit details are provided below (delimited by triple percent signs):
|
191 |
+
%%% {input} %%%
|
192 |
+
Use the curriculum unit and lesson description to generate a lesson plan using the universal by design methdology.
|
193 |
+
Engagement: How will you capture the students' interest and introduce the topic at the start of the lesson? Reference relevant unit details by section and number (example: Key Concepts #4, Skills #2, etc ).
|
194 |
+
Steps: Build a step-by-step sequence and time schedule of activities and discussions for this lesson. Reference relevant unit details by section and number (example: Key Concepts #4, Skills #2, etc ).
|
195 |
+
Alternative Representations: List 3 different ways the key concepts might be expressed or explained that could help different learners make the connection.
|
196 |
+
Resources: What tools, materials, or resources will you need to effectively deliver this lesson?
|
197 |
+
Resource add-ons: List 3 additional technologies, tools or resources ( not listed above ) that might add more interest or enagagement for students. Explain why you chose them.
|
198 |
+
Assessment: Create a plan to measure students' understanding and mastery of the lesson's objectives. List at least 3 alternative ways for students to express their knowledge and skills. Reference the example assessments in the unit details. Reference relevant unit details by section and number (example: Key Concepts #4, Skills #2, etc ).
|
199 |
+
Support: List 5 ways to provide support and feedback to each student.
|
200 |
+
Expression: List 5 examples of ways they might personally express themselves throughout the lesson.
|
201 |
+
Unit connections: Summarize the ways that this lesson plan supports the unit details. Reference relevant unit details by section and number (example: Key Concepts #4, Skills #2, etc ).
|
202 |
+
"""
|
|
|
|
|
203 |
|
204 |
lesson_builder = Agent(prompt_template=lesson_builder_prompt)
|
205 |
|
|
|
207 |
for next_token, content in unit_generator.stream(input):
|
208 |
yield(content)
|
209 |
|
210 |
+
def generate_lesson_ideas(unit, interests):
|
211 |
+
input = unit + " \n\n STUDENT INTERESTS (delimited by triple ampersand): @@@ " + interests + " @@@"
|
212 |
+
for next_token, content in lesson_idea_generator.stream(input):
|
213 |
yield(content)
|
214 |
|
215 |
+
def generate_lesson_plan(unit,lesson_description, student_interests):
|
216 |
+
input = unit + "Lesson description below (delimited by triple ampersand): @@@ " + lesson_description + " @@@ " + "\n\nSTUDENT INTEREST description below (delimited by triple hashtag): ### " + student_interests + " ###"
|
217 |
for next_token, content in lesson_builder.stream(input):
|
218 |
yield(content)
|
219 |
|
|
|
222 |
with app:
|
223 |
|
224 |
gr.Markdown(
|
225 |
+
"""
|
226 |
+
# Syllabo
|
|
|
|
|
227 |
|
228 |
+
A suite of generative ai tools for designing and building learning experiences.
|
|
|
229 |
|
230 |
""")
|
231 |
|
232 |
+
with gr.Tab("Unit Builder"):
|
233 |
gr.Markdown(
|
234 |
"""
|
235 |
+
Use this tool to create a unit inspired by the Understanding by Design framework.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
""")
|
237 |
|
238 |
+
unit_vision = gr.Textbox(label="Enter topic, activity or standard(s):")
|
239 |
+
b1 = gr.Button("Make Unit")
|
240 |
+
unit = gr.Textbox(label="Unit",show_copy_button=True)
|
241 |
|
242 |
+
with gr.Tab("Lesson Generator"):
|
243 |
gr.Markdown(
|
244 |
"""
|
245 |
+
Use this tool to generate ideas for lesson activities. \n
|
246 |
+
The tool will select from a range of pedagogies.\n
|
247 |
+
|
248 |
+
Note: It will use the unit generated from the "unit builder" and any notes on student interest you add below. \n
|
249 |
+
If you like an idea copy and paste it into the next tool.
|
|
|
|
|
|
|
250 |
""")
|
251 |
+
student_interests = gr.Textbox(label="General student interests, cultures & strengths")
|
252 |
+
b2 = gr.Button("Generate Activities")
|
253 |
+
lesson_ideas = gr.Textbox(label="Lesson Concepts")
|
254 |
|
255 |
+
with gr.Tab("Lesson Builder"):
|
256 |
gr.Markdown(
|
257 |
"""
|
258 |
+
This tool takes a lesson idea and generates a lesson plan inspired by the Universal by Design framework.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
""")
|
260 |
lesson_description = gr.Textbox(label="Input lesson idea:")
|
261 |
b3 = gr.Button("Generate Lesson Plan")
|
262 |
+
lesson_plan = gr.Textbox(label="Lesson Plan",show_copy_button=True)
|
263 |
|
264 |
b1.click(generate_unit, inputs=unit_vision, outputs=unit)
|
265 |
+
b2.click(generate_lesson_ideas, inputs=[unit,student_interests], outputs=lesson_ideas)
|
266 |
+
b3.click(generate_lesson_plan, inputs=[unit,student_interests,lesson_description], outputs=lesson_plan)
|
267 |
|
268 |
+
app.queue().launch(debug=True, share=True)
|