Skip to content

docs: fix the async realtime example in the README - #193

Merged
lumpinif merged 1 commit into
mainfrom
docs/readme-async-websocket
Nov 27, 2026
Merged

lumpinif merged 1 commit into
mainfrom
docs/readme-async-websocket

Conversation

@lumpinif

@lumpinif lumpinif commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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.
Copilot AI lite review requested due to automatic review settings November 27, 2026 09:03
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-27T09:03:58.590844Z
We couldn’t complete this review. Comment @codex review to try again.
4488b26 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

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.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: abersheeran

Merge Risk: Minimal · up to 4488b

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: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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.

Review effort: Lite

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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.

@lumpinif
lumpinif merged commit 919cf78 into main Nov 27, 2026
28 checks passed
@lumpinif
lumpinif deleted the docs/readme-async-websocket branch November 27, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants