Skip to content

docs(stt): use the Python SDK for realtime speech to text and model selection - #402

Draft
lumpinif wants to merge 1 commit into
fishaudio:mainfrom
lumpinif:docs/python-sdk-realtime-stt
Draft

lumpinif wants to merge 1 commit into
fishaudio:mainfrom
lumpinif:docs/python-sdk-realtime-stt

Conversation

@lumpinif

@lumpinif lumpinif commented Nov 23, 2026 •

Copy link
Copy Markdown

Important

Do not merge before fishaudio/fish-audio-python#170 is merged and released to PyPI. The examples here use arguments that do not exist in fish-audio-sdk 1.4.0.

What changes

fish-audio-python#170 adds client.asr.stream_websocket() (realtime speech to text) and a model argument on asr.transcribe(). This PR updates the pages that told readers to work around their absence.

Realtime speech to text uses the SDK

  • features/speech-to-text/realtime.mdx: the quick start is a Python SDK example. The WebSocket steps stay under "Without the SDK". The line "The SDKs do not wrap this endpoint" is gone.
  • developer-guide/sdk-guide/cookbook/realtime-transcription.mdx: the recipe is the SDK script (sync and async tabs), followed by the session options and error handling. The websockets + msgpack and Node.js scripts are kept unchanged under "Without the SDK", which states that the TypeScript SDK does not support the endpoint yet.
  • Both pages say that transcripts start with a speaker tag by default and show diarize=False.

Selecting the ASR model

Python examples pass model="transcribe-1-pro" instead of request_options=RequestOptions(additional_headers={"model": "transcribe-1-pro"}). Examples that also set a timeout keep RequestOptions(timeout=900). JavaScript examples are unchanged.

  • features/speech-to-text.mdx
  • developer-guide/models-pricing/migrate-from-transcribe-1.mdx
  • developer-guide/sdk-guide/cookbook/batch-transcribe-with-language-hint.mdx
  • developer-guide/sdk-guide/cookbook/transcribe-to-captions.mdx
  • developer-guide/sdk-guide/cookbook/voice-agent-loop.mdx
  • api-reference/endpoint/openapi-v1/speech-to-text.mdx

Tests: tests/cookbooks/specs.py follows the recipe's new block order and adds cases for the two SDK scripts; requirements.txt asks for fish-audio-sdk>=1.5.0.

To confirm before merging

  • The required SDK version. Every page says "fish-audio-sdk 1.5.0 or later", which is what release-please should produce for a feat:. Confirm against the actual release.
  • api-reference/sdk/python/* is generated from the SDK and is not touched here; it updates when the SDK is released.

Verified

Against the SDK branch of fish-audio-python#170 and the live API:

  • Every changed Python example was run as published: the realtime quick start, the three realtime recipe blocks (SDK sync, SDK async, diarize=False), and all transcribe(model="transcribe-1-pro") examples on the six pages.
  • pytest tests/cookbooks for the changed recipes (realtime-transcription, transcribe-to-captions, batch-transcribe-with-language-hint, voice-agent-loop): 8 passed.
  • mint dev: the eight changed pages render (HTTP 200, no MDX errors).
  • mint validate, mint broken-links, mint openapi-check: no findings in the changed files. Both still report existing problems in temp/, snippets/*.jsx and the generated api-reference/sdk/python/overview.mdx.
  • prettier --check on the changed pages: no new findings (two existing ones on main remain).

Not run: the JavaScript cookbook tests (tests/js); no JavaScript example changed.

🤖 Generated with Claude Code


Start Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…election

fish-audio-python adds client.asr.stream_websocket() for realtime
speech to text and a model argument on asr.transcribe()
(fishaudio/fish-audio-python#170).

Realtime: the feature page's quick start and the "Transcribe a live
audio stream" recipe now use the SDK (sync and async), say that
transcripts carry speaker tags by default and how diarize=False turns
them off, and list the session options. The WebSocket and MessagePack
clients stay under "Without the SDK", for JavaScript (the TypeScript
SDK does not support the endpoint yet) and other languages.

Model selection: Python examples pass model="transcribe-1-pro" instead
of RequestOptions(additional_headers={"model": ...}); examples that set
a timeout keep RequestOptions for it. JavaScript examples are
unchanged.

Each page notes that the new arguments require fish-audio-sdk 1.5.0 or
later. The cookbook specs follow the recipe's new block order and cover
the two SDK scripts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Nov 23, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit e89366b.

Approve preview

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

@abersheeran abersheeran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this in draft until a PyPI release contains the APIs from fishaudio/fish-audio-python#170. Verify the minimum version in the examples and cookbook requirements against the released package, then run the cookbook cases with that release.

The latest check-openapi job also fails at Ensure committed schema is current because api-reference/openapi.json differs from the fetched schema. Please rerun that check once the base branch has the current schema.

OpenAPI check log

This branch has not been deployed

No deployments
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