Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces multi-speaker script parsing and annotation support for TTS models, splitting scripts into individual speaker turns for modern models while preserving plain text blocks for legacy ones. It also adds a utility to strip UTF-8 BOMs from input files. The feedback suggests adding defensive checks to prevent potential nil pointer dereferences when handling speech configurations and to handle empty speaker lists gracefully to avoid malformed regular expressions.
2ynn
force-pushed
the
test/bb1
branch
2 times, most recently
from
October 6, 2026 22:39
bd3b523 to
02ee6f6
Compare
Contract tests for the annotated multi-speaker input: one text block per turn with its speech_metadata speaker and the label removed on current models, one plain block on legacy ones (also via a `models/` id), a Windows-saved -f script (byte-order mark, CRLF) splitting into turns, and text before the first label failing locally with exit 2 and no request sent.
wanlin31
approved these changes
Oct 6, 2026
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.
Contract tests for the multi-speaker input introduced in #71 (
1f78c8a). The only file this PR changes istests/contract/tts_test.go.Assertions follow #71's behaviour, where the
<Speaker>:label is removed from the turn text (hi.,yo.), not kept (Alice: hi.) as in the earlier draft of the fix.TestTTSMultiSpeakerInput: on the default model, one text block per turn annotated withspeech_metadatanaming its speaker, label removed. Ongemini-3.1-flash-tts-previewandmodels/gemini-3.1-flash-tts-preview, one plain block.TestTTSMultiSpeakerScriptFile: a Windows-saved-fscript (UTF-8 byte-order mark, CRLF) splits intohi./yo..TestTTSMultiSpeakerRejectsUnlabelledText: text before the first label exits 2 withtext before the first speaker label: "Intro.", and no request is sent.go test ./tests/contract/passes on this branch.