-
Notifications
You must be signed in to change notification settings - Fork 27
Allow user to provide a theme for audio lesson generation #502
Copy link
Copy link
Open
Description
Idea
Let the user optionally provide a theme (a short phrase) when generating a daily audio lesson. The theme would be passed to the LLM prompt so it tries to set the dialogues in that context.
For example, a user learning Dutch could type "at the supermarket" and the generated lesson dialogues would use supermarket-related scenarios for the vocabulary words.
Implementation
Changes span both API and frontend (~20 lines of logic total):
API (this repo)
- Prompt template (
audio_lessons/prompts/meaning_lesson--...v2.txt): Add a{theme}placeholder near the "brief scenario" instruction (line 12) - Script generator (
audio_lessons/script_generator.py): Addtheme=Noneparam togenerate_lesson_script(), pass to template - Generation pipeline: Thread
themethroughgenerate_daily_lessonendpoint →preparationdict → background thread →build_daily_lesson()→generate_lesson_script()
Frontend (zeeguu/web)
- TodayAudio.js: Add an optional text input on the generate screen, send as form data
Notes
- Theme should be optional — if not provided, behavior is unchanged
- The prompt should treat the theme as a suggestion, not a hard requirement (some words may not fit the theme naturally)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels