Repository navigation
Conversation
stream_websocket (sync and async) takes text_format, and ASRResults has the field, so a transcribe-stream-2 session can choose spoken or written numbers and times. It is sent only when set: transcribe-stream-1 refuses the field, null included. transcribe-stream-1 stays the default model.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
…be configure refusal stream_websocket(text_format=...) now checks the value as ASRResults does, so a typo such as "Written" raises before the connection opens instead of being sent. The ASRResults docstring now says what transcribe-stream-1 does with the field at session start (invalid_config ends the session) and in a mid-session configure (configured with ok False, session goes on).
This branch has not been deployed
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
transcribe-stream-2support to realtime speech to text, for the launch on 2026-12-02. Protocol per fishaudio/docs#403.Before / after
stream_websocketcould connect withmodel="transcribe-stream-2"(any string was passed through), but there was no way to sendresults.text_format, the one field onlytranscribe-stream-2takes. The docstring and README namedtranscribe-stream-1only.stream_websocket(sync and async) takestext_format: "spoken" | "written", andASRResultshas the same field (new type aliasASRTextFormat, exported fromfishaudio.types). The direct parameter wins overconfig.results.text_format, likedraftsanddiarize.Noneleaves it out, becausetranscribe-stream-1refuses it whatever its value,nullincluded.modeldocstring and the README name both models.transcribe-stream-1stays the default.Verified against the live API (public endpoint, test key)
The clip was TTS audio of "I paid $25 at 3:30 pm on March 4th, and it cost 12 percent more.", sent as 16 kHz PCM with manual turn detection.
session_started.configtranscribe-stream-2, notext_formattranscribe-stream-2,text_format: writtentranscribe-stream-2,text_format="spoken"(async client, direct parameter)text_format: spokentranscribe-stream-2,config.results.text_format="written"text_format: writtentranscribe-stream-1,text_format="spoken"ASRRealtimeErrorinvalid_config: "results.text_format is not supported by this model"transcribe-stream-1, defaulttranscribe-stream-1, notext_formatkeyTests
One unit test:
text_formatreachesresultsin the encodedconfigwhen set, and is absent when it is not. The existing "defaults send only the audio format" test already covers a config with no results.ruff check,ruff format --check,ty checkand the unit suite (751 passed, 2 skipped) are green locally.Draft until the launch is live and this has been reviewed.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.