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): Add theme=None param to generate_lesson_script(), pass to template
- Generation pipeline: Thread
theme through generate_daily_lesson endpoint → preparation dict → 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)
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)
audio_lessons/prompts/meaning_lesson--...v2.txt): Add a{theme}placeholder near the "brief scenario" instruction (line 12)audio_lessons/script_generator.py): Addtheme=Noneparam togenerate_lesson_script(), pass to templatethemethroughgenerate_daily_lessonendpoint →preparationdict → background thread →build_daily_lesson()→generate_lesson_script()Frontend (zeeguu/web)
Notes