Skip to content

Support suggestion_type for audio lesson generation#518

Merged
mircealungu merged 6 commits intomasterfrom
feature/typed-audio-lesson-suggestions
Apr 3, 2026
Merged

Support suggestion_type for audio lesson generation#518
mircealungu merged 6 commits intomasterfrom
feature/typed-audio-lesson-suggestions

Conversation

@mircealungu
Copy link
Copy Markdown
Member

Summary

  • Accept suggestion_type parameter ("topic" or "situation") alongside topic_suggestion
  • Topics set a thematic context in the LLM prompt; situations structure the lesson as a roleplay
  • Word/char limits relaxed from 4 words / 24 chars to 6 words / 48 chars
  • Add VALID_SUGGESTION_TYPES constant to avoid stringly-typed validation

Test plan

  • POST with suggestion_type=topic + topic_suggestion=cooking → prompt contains TOPIC directive
  • POST with suggestion_type=situation + topic_suggestion=job interview → prompt contains SITUATION directive
  • POST with unknown suggestion_type=foo → silently treated as topic
  • POST without topic_suggestionsuggestion_type is ignored

🤖 Generated with Claude Code

Companion web PR: zeeguu/web#1015

Accept "topic" or "situation" as suggestion_type alongside
topic_suggestion. Use different LLM prompt phrasing: topics set a
thematic context while situations structure the lesson as a roleplay.
Word/char limits relaxed to 6 words / 48 chars.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

ArchLens detected architectural changes in the following views:
diff

mircealungu and others added 5 commits April 3, 2026 13:28
Add suggestion_type column to daily_audio_lesson and
audio_lesson_meaning tables. Includes migration script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously only topic_suggestion text was compared when checking
whether to regenerate. Now suggestion_type is also compared, and
included in the lesson response dict.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename column and all references from topic_suggestion to suggestion
since the field now covers both topics and situations.
Includes migration to rename the DB column.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mircealungu mircealungu merged commit 200a3ea into master Apr 3, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant