Week 8 Session 1 Lesson Plan Prompt Engineering
Week 8 Session 1 Lesson Plan Prompt Engineering
course, titled *"Automation and Workflow Integration."* This session advances the intermediate phase
(Weeks 6-10), building on technical prompting skills from Week 7, Session 2 (data analysis and coding) by
introducing automation and workflow integration using APIs and scripts. It’s designed for a 90-minute
class (1.5 hours), combining lecture, demonstration, and hands-on practice to scale up prompt
engineering capabilities.
---
**Date**: [Insert specific date, e.g., October 21, 2025, assuming a Tuesday/Thursday schedule]
**Duration**: 90 minutes
**Target Audience**: College students (beginner to intermediate level, mixed technical backgrounds)
**Prerequisites**: Attendance at prior sessions; familiarity with coding prompts and basic Python from
Week 4, Session 2
---
1. Understand how to automate prompt execution using APIs and batch processing.
2. Integrate AI-generated outputs into simple workflows (e.g., saving results, looping tasks).
---
- Access to a generative AI tool with an API (e.g., Grok via xAI API, OpenAI API, or a free alternative like
Hugging Face Inference API)
- Python environment: Instructor’s computer with Python (e.g., Jupyter Notebook); students’ laptops
with Python (or lab setup)
- Whiteboard or digital equivalent (e.g., Jamboard) for notes and script breakdowns
- Handout: "Automation Scripting Guide" (optional, with code snippets like `requests.post()`, file-saving
tips)
- Homework submissions: Students’ notes from Week 7, Session 2 (data/coding prompt, output, tweak
idea)
---
- Instructor welcomes students, recaps Week 7, Session 2 (prompting for data analysis and coding).
- “What was your prompt?” (e.g., “Write a Python loop for 1-5”).
- **Transition**: “You’ve coded with prompts manually. Now, let’s automate that with APIs and
workflows.”
- **Content**:
- **Why Automate?**: Save time, scale tasks (e.g., generate 100 summaries vs. 1), reduce repetition.
- Connect Python to AI tools (e.g., Grok API sends “Write…” → gets response).
- **Workflow Integration**:
- **Example Script**:
```python
import requests
responses = []
for p in prompts:
responses.append(r.text)
f.write("\n".join(responses))
```
- **Delivery**:
- **Engagement**: Pause at 0:25 to ask, “What task would you automate?” (Quick responses, e.g.,
“Summaries,” “Code snippets”).
- **Purpose**: Show automation’s power, refresh scripting basics.
1. **Setup (5 min)**:
- Instructor explains: “You’ll script a prompt to run 3+ times, save outputs, and debug if needed.”
```python
import requests
responses = []
responses.append(r.text)
f.write("\n".join(responses))
```
- Students:
- Run the starter script, check “tips.txt” (e.g., “Stir well. Focus hard. Debug fast.”).
- Modify it: Change prompt (e.g., “Write a joke about…”), list (e.g., “dogs, cats, birds”), or file name.
- Stretch goal: Add a condition (e.g., “If short, add ‘Keep it brief’”).
- **Content**:
- Recap: “Automation scales your prompts—APIs and scripts make it happen fast.”
- Debrief Activity: Invite 1-2 pairs to share (e.g., “My jokes saved perfectly!”). Note fixes on whiteboard
(e.g., “Check API key”).
- Next Session Preview: “We’ll integrate prompts with external tools—like spreadsheets—for
workflows.”
- Homework: “Script a prompt to run 3 times, save outputs. Bring code, file, and one pro/con.”
---
### Assessment
- **Formative**:
---
- **If time runs short**: Shorten pair troubleshoot to 10 minutes, summarize fixes as a group.
- **If tech fails**: Use pre-run outputs (e.g., “Here’s my saved tips…”), focus on code review.
- **If students struggle**: Simplify to 1 prompt (no loop), or pair with coders.
---
- Prep for Week 8, Session 2: Prepare spreadsheet integration examples, review homework.
---
This plan scales prompting with automation, keeping it practical and coding-focused. It builds on prior
scripting while introducing workflows, suitable for varied skill levels. Let me know if you’d like tweaks—
like more API focus or simpler tasks!