notebooklm: send audio custom instructions as UniversalAudioDetails.prompt - #40
Open
faughnn wants to merge 1 commit into
Open
notebooklm: send audio custom instructions as UniversalAudioDetails.prompt#40faughnn wants to merge 1 commit into
faughnn wants to merge 1 commit into
Conversation
…rompt Custom instructions for an Audio Overview were unusable: any non-empty instruction string failed with InvalidInput (API error 3 on R7cb6c). CreateAudioOverviewWithOptions gated the CreateUniversalArtifact path on opts.Instructions == "", so supplying instructions diverted the request to the legacy CreateAudioOverviewRequest.custom_instructions field, which the server no longer accepts. UniversalAudioDetails already carries a prompt field (field 1) for exactly this, but it was never populated. Populate prompt from opts.Instructions and drop the emptiness condition, so instructions travel on the modern request instead of diverting to the legacy one. Adds a round-trip test pinning prompt at wire index 0, since a silent regression there drops the steer without surfacing an error. Verified against the live API: instructions are accepted and honoured. A generated overview instructed to open with a specific marker phrase began with exactly that phrase, where the same request previously errored.
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.
Problem
Custom instructions for an Audio Overview are currently unusable. Any non-empty
instruction string fails:
The same notebook succeeds immediately with
"", so it is not an auth, sourceor notebook problem.
Cause
CreateAudioOverviewWithOptionsgates theCreateUniversalArtifactpath onopts.Instructions == "":So supplying instructions actively diverts the request away from the shape the
server accepts and into the legacy one it no longer does. Meanwhile
UniversalAudioDetailsalready carries apromptfield (field 1) intended forexactly this, and nothing populates it.
Fix
Populate
promptfromopts.Instructionsand drop the emptiness condition fromthe gate, so instructions ride the modern request rather than diverting to the
legacy one. Behaviour with empty instructions is unchanged.
Verification
Against the live API, not just unit tests:
InvalidInput.told to open with a specific marker phrase began with exactly that phrase.
One caveat worth recording for anyone testing this: a sweeping style instruction
("speak entirely in limericks") was accepted but not followed, so the model
appears to decline wholesale format overrides. Targeted instructions about
content, emphasis and delivery do take effect. Absence of an error is therefore
not proof the steer applied — check the output.
Test
Adds
TestUniversalAudioDetailsPromptRoundTrip, pinningpromptat wire index0. A regression there would silently drop the steer and generate default audio
with no error surfaced, which is the failure mode this change exists to remove.
go test ./notebooklm/... ./cmd/...passes; no existing test asserted the oldgating.