You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs: fix the async realtime example in the README - #193
The asynchronous example under "Real-time Streaming" awaited client.tts.stream_websocket(), which is an async generator, so it raised TypeError: 'async_generator' object can't be awaited, and then passed the result to play(), which takes a synchronous iterable. The example is now complete and iterates the stream. The extras install command is quoted so it works in zsh.
Verified: the new example ran against fish-audio-sdk 1.6.0 and wrote a valid MP3.
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by CodeRabbit
Documentation
Updated the installation example to quote the optional dependency extra.
Revised the asynchronous real-time streaming example to use the async streaming interface and save received audio chunks to output.mp3 instead of passing a completed result to playback.
The example awaited client.tts.stream_websocket(), which is an async
generator, so it raised TypeError, and passed the result to play(), which
takes a synchronous iterable. Show a complete example that iterates the
stream. Quote the extras install so it works in zsh.
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.
The README now quotes the optional dependency extra in the installation command. Its asynchronous streaming example uses AsyncFishAudio and writes received chunks to output.mp3.
Changes: README examples
Layer / File(s)
Summary
Installation and streaming examples README.md
The installation command quotes the optional dependency extra. The asynchronous example uses AsyncFishAudio, iterates stream_websocket, and writes received chunks to output.mp3.
This documentation-only change fixes a broken async streaming example and quotes the install command for zsh. The only remaining remark concerns filename reuse in an example snippet, which has negligible impact. No functional risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "docs: fix the async realtime example in the README" matches the main change. The README's asynchronous Real-time Streaming example now iterates the async generator from stream_websocket ins…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "docs: fix the async realtime example in the README" matches the main change. The README's asynchronous Real-time Streaming example now iterates the async generator from stream_websocket instead of awaiting it and passing the result to play(). The title does not mention the secondary change of quoting the optional dependency extra in the installation example, which is acceptable because the title need not cover every detail.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
The reason will be displayed to describe this comment to others. Learn more.
🟢 Approval recommended
No active review issues are identified, and the README changes address the async streaming, audio output, and zsh installation concerns described.
No open issues 🎉
What changed in this PR
Fixes the README’s asynchronous real-time TTS example so it correctly consumes the async WebSocket generator and writes streamed audio to an MP3 file, while making the optional dependency installation command compatible with zsh.
Changes:
Quotes fish-audio-sdk[utils] in the installation command.
Uses async for to consume the streaming generator.
Writes received audio chunks to output.mp3.
File
Description
README.md
Corrects the extras installation syntax and updates the asynchronous real-time streaming example.
The reason will be displayed to describe this comment to others. Learn more.
Additional comments: 1
README.md-260-260: 1
260-260: Minor · Data Integrity & Integration · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Avoid overwriting the Quick Start output.
The Quick Start also writes output.mp3. This line truncates that file before the stream connects, even if the connection fails. (raw.githubusercontent.com)
Use a distinct filename and exclusive creation, or warn users before replacing the file.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 4916c117-68d7-42f3-9a07-4e8281be37af
Commits
Reviewing files that changed from the base of the PR and between a74c4dc and 4488b26.
Files selected for processing: 1
README.md
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
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
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.
The asynchronous example under "Real-time Streaming" awaited
client.tts.stream_websocket(), which is an async generator, so it raisedTypeError: 'async_generator' object can't be awaited, and then passed the result toplay(), which takes a synchronous iterable. The example is now complete and iterates the stream. The extras install command is quoted so it works in zsh.Verified: the new example ran against
fish-audio-sdk1.6.0 and wrote a valid MP3.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
output.mp3instead of passing a completed result to playback.