AI Instructor Live Labs Included

OpenAI: Pages Unwritten — Build a Choose-Your-Own-Adventure

Build a playable choose-your-own-adventure visual novel with the OpenAI API. Add a storyteller, branching choices, scene backgrounds with gpt-image-1, story-arc tracking, and streaming — one exercise at a time.

Intermediate
6h 50m
3 Lessons
SMU-OPENAI-NOVEL
Pages Unwritten — Visual Novel Architect Badge

View badge details

About This Course

Build a fully playable web-based visual novel powered by the OpenAI API. You'll start with a complete Flask game shell title screen, genre picker, choice rendering, page-flip UI and progressively wire up OpenAI to bring it alive. Each exercise adds a new capability: a storyteller that writes scene narration, structured-output choice branches, AI-generated scene backgrounds via gpt-image-1, plot-arc tracking with ending detection, and streaming narration with compressed long-term memory. By the end you'll have an infinitely replayable choose-your-own-adventure across five genres, plus practical experience with text generation, structured outputs, image generation, streaming, and context-window management.

Course Curriculum

3 Lessons
01
Lab Exercise
Lab Exercise

Pages Unwritten Lab 1 — Storyteller and Branching Choices

2h 15m 2 Exercises

Wire up the OpenAI client to a working Flask visual-novel shell. In this first lab you'll build a storyteller system prompt that returns live narration, then upgrade to JSON-mode structured output so each scene returns both prose and a fresh list of branching choices.

Summon the Storyteller Wire up the OpenAI client, build the storyteller system prompt, and replace the canned opening scene with a live LLM-generated one. ~45 min
Branching Choices with Structured Output Switch from plain text to JSON-mode structured output so the storyteller returns both narration and a fresh list of choices in one call. ~45 min
02
Lab Exercise
Lab Exercise

Pages Unwritten Lab 2 — Images and Story Arc

2h 15m 2 Exercises

Pick up where Lab 1 left off — the storyteller and branching choices are already wired in. In this lab you'll generate per-scene background art with gpt-image-1 and extend the JSON schema so the model tracks plot flags, three-act structure, and detects natural endings.

Bring the World to Life with Images Generate a scene background for every page using gpt-image-1, with a per-scene cache so you don't pay for the same image twice. ~45 min
Story Arc and Endings Extend structured output so the LLM tracks act number, plot flags, and ending conditions. Solve the "infinite branches vs. coherent story" problem. ~45 min
03
Lab Exercise
Lab Exercise

Pages Unwritten Lab 3 — Streaming, Memory, and Voice

2h 20m 2 Exercises

Pick up the visual novel from Lab 2 with the storyteller, choices, scene art, and ending detection already in place. In this final lab you'll stream narration token-by-token with bounded memory compression, then add voiced narration with the OpenAI Speech (TTS) API mapped per genre.

Streaming and the Long Memory Stream narration token-by-token as it generates, and compress old beats into a "story so far" summary so the context window never blows up. ~55 min
Give the Storyteller a Voice Add audible narration to every scene with the OpenAI Speech (TTS) API. Map each genre to a fitting voice, cache the mp3s on disk, and serve them through a new /api/speech route the frontend toggle already calls. ~40 min

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 3 Hands-on Lessons
  • 6 Months Access
  • Completion Badge
  • Certificate of Completion
Pages Unwritten — Visual Novel Architect Badge

Earn Your Badge

Complete all lessons to unlock the Pages Unwritten — Visual Novel Architect achievement badge.

Category
Skill Level Intermediate
Total Duration 6h 50m
Pages Unwritten — Visual Novel Architect Badge
Achievement Badge

Pages Unwritten — Visual Novel Architect

Awarded for completing Pages Unwritten, a streaming visual-novel built on the OpenAI API — chat completions, JSON-mode structured output, gpt-image-1 generation, story-arc tracking, streaming, and memory compression.

Course OpenAI: Pages Unwritten — Build a Choose-Your-Own-Adventure
Criteria Complete all five exercises of the Pages Unwritten course: wire up the storyteller, branch with structured output, paint scenes with gpt-image-1, track three-act structure, and stream with bounded memory.

Skills You'll Earn

OpenAI API Chat Completions JSON-mode Structured Output gpt-image-1 Image Generation Server-Sent Events Streaming Context Window Management Flask Web Development

Complete all lessons in this course to earn this badge