AI student podcast backend, part 3#72707
Open
Nokondi wants to merge 4 commits into
Open
Conversation
Adds the AiStudentPodcastObjective join model and updates the AiStudentPodcast has_many :objectives association to use :through. Adds StudentPodcastPromptHelper, which builds the OpenAI system prompt for student podcast script generation from a lesson plus a selected subset of learning objectives. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds AiStudentPodcastsHelper, which generates a podcast script via OpenAI and converts it to audio via ElevenLabs, then uploads the result to S3. The helper short-circuits when an mp3 already exists in S3, when an existing podcast record already has a saved script, when another user has already generated a script for the same lesson + objective set, or when ElevenLabs credits are exhausted. Includes inner OpenaiClient and ElevenlabsClient HTTP wrappers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds AiStudentPodcastsController with show and generate_podcast endpoints. generate_podcast deduplicates against any existing podcast record for the same user + lesson + exact objective set before enqueuing AiStudentPodcastsJob, which delegates to AiStudentPodcastsHelper.create_and_save_to_s3 to produce and upload the audio. Both endpoints are gated on the 'lesson-tutor' single user experiment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Erin007
reviewed
May 19, 2026
|
|
||
| # GET /ai_student_podcasts/:id | ||
| def show | ||
| return head :forbidden unless SingleUserExperiment.enabled?(user: current_user, experiment_name: 'lesson-tutor') |
Contributor
There was a problem hiding this comment.
🤔 Does this work? The experiment flag that we're using so far is a url param for a client side "experiment"
code-dot-org/apps/src/util/experiments.js
Line 67 in ced7e45
Contributor
Author
There was a problem hiding this comment.
My understanding is that you don't have to set up a backend experiment - you just have to add a SingleUserExperiment with that name for whatever user / user subset you want to access the experiment.
Base automatically changed from
add-ai-student-podcast-2-generation-helper
to
staging
May 19, 2026 19:08
…dd-ai-student-podcast-3-controller-and-job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds AiStudentPodcastsController with show and generate_podcast endpoints. generate_podcast deduplicates against any existing podcast record for the same user + lesson + exact objective set before enqueuing AiStudentPodcastsJob, which delegates to AiStudentPodcastsHelper.create_and_save_to_s3 to produce and upload the audio. Both endpoints are gated on the 'lesson-tutor' single user experiment.
Links
Tech Spec
Testing story
Adds additional unit tests
Deployment notes
Privacy and security