Week 8 Session 2 Lesson Plan
Week 8 Session 2 Lesson Plan
course, titled *"Combining Prompts with External Tools."* This session continues the intermediate phase
(Weeks 6-10), building on the automation skills from Week 8, Session 1 by integrating AI-generated
outputs with external tools like spreadsheets. It’s designed for a 90-minute class (1.5 hours), combining
lecture, demonstration, and hands-on practice to create practical workflows.
---
**Date**: [Insert specific date, e.g., October 23, 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 automation scripting from Week 8,
Session 1
---
1. Understand how to integrate AI prompt outputs with external tools (e.g., spreadsheets).
2. Design workflows that connect AI generation to practical applications (e.g., data storage, analysis).
3. Write and test a script that sends prompts to an AI tool and saves results to a spreadsheet-compatible
format.
---
- Access to a generative AI tool with an API (e.g., Grok via xAI API, OpenAI API, or a free alternative)
- Python environment: Instructor’s computer with Python and `csv` module (e.g., Jupyter Notebook);
students’ laptops with Python (or lab setup)
- Spreadsheet software: Excel, Google Sheets, or similar for demo (optional student access)
- Whiteboard or digital equivalent (e.g., Jamboard) for notes and workflow sketches
- Handout: "Prompt-to-Spreadsheet Guide" (optional, with code like `csv.writer`, sample CSV layouts)
- Homework submissions: Students’ notes from Week 8, Session 1 (automation script, output file,
pro/con)
---
- Instructor welcomes students, recaps Week 8, Session 1 (automation with APIs and batch processing).
- “What did your script do?” (e.g., “Generated 3 tips, saved to file”).
- “What was in your output file?” (e.g., “Cooking: Stir. Studying: Focus.”).
- “One pro or con?” (e.g., “Pro: Fast! Con: File formatting messy”).
- **Transition**: “You’ve automated prompts. Now, let’s pipe those outputs into tools like spreadsheets
for real workflows.”
#### 0:10–0:30 | Lecture: Combining Prompts with External Tools (20 minutes)
- **Content**:
- **Why Integrate?**: Organize outputs (e.g., spreadsheets), analyze results, share easily vs. plain text
files.
- **External Tools**:
- **Workflow Basics**:
- **Example Script**:
```python
import requests
import csv
api_url = "API_URL"
api_key = "YOUR_KEY"
prompts = ["Ad for coffee", "Ad for tea", "Ad for juice"]
responses = []
for p in prompts:
responses.append([p, r.text])
writer = csv.writer(f)
writer.writerow(["Prompt", "Output"])
writer.writerows(responses)
```
- **Delivery**:
- **Engagement**: Pause at 0:25 to ask, “What tool do you use that could take AI outputs?” (Quick
responses, e.g., “Sheets,” “Notes”).
- **Content**: Students script a prompt task and save outputs to a CSV file.
1. **Setup (5 min)**:
- Instructor explains: “You’ll script 3+ prompts, save outputs to a CSV, and test it in a spreadsheet.”
```python
import requests
import csv
api_key = "YOUR_KEY"
data = []
for t in topics:
full_prompt = prompt + t
writer = csv.writer(f)
writer.writerow(["Topic", "Tip"])
writer.writerows(data)
```
- Students:
- Modify it: Change prompt (e.g., “Suggest a gift for…”), list (e.g., “mom, dad, friend”), or columns
(e.g., add “Date”).
- Test, open CSV in spreadsheet, note issues (e.g., “Quotes missing” → tweak prompt).
- **Content**:
- Recap: “Prompts plus tools like spreadsheets make workflows—automation meets practicality.”
- Debrief Activity: Invite 1-2 groups to share (e.g., “My gifts list is ready for shopping!”). Note tips on
whiteboard (e.g., “CSV needs commas”).
- Next Session Preview: “We’ll explore ethics and bias in prompting—keeping AI responsible.”
- Homework: “Script a prompt-to-CSV workflow (3+ outputs). Bring code, CSV, and one pro/con.”
- **Activity**: Quick Q&A (e.g., “Any CSV messes?” “Tool tips?”).
---
### Assessment
- **Formative**:
---
- **If time runs short**: Shorten group share to 10 minutes, summarize as a group.
- **If tech fails**: Use pre-run CSVs (e.g., “Here’s my tips.csv…”), focus on code explanation.
- **If students struggle**: Simplify to 1 prompt (no loop), or pair with coders.
---
---
This plan enhances automation with practical tool integration, keeping it hands-on and workflow-
focused. It builds on scripting skills while introducing usability, suitable for all levels. Let me know if you’d
like tweaks—like more tools or simpler tasks!