Skip to content

feat: add S2.1 Pro model support - #162

Merged
leng-yue merged 1 commit into
fishaudio:mainfrom
JarodMica:fix/s2-1-model-types
Jul 31, 2026
Merged

feat: add S2.1 Pro model support#162
leng-yue merged 1 commit into
fishaudio:mainfrom
JarodMica:fix/s2-1-model-types

Conversation

@JarodMica

@JarodMica JarodMica commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Default synchronous, asynchronous, and WebSocket TTS calls to S2.1 Pro. Keep undocumented model values pass-through but emits a warning to callers that model may not supported and behavior may fallback to default server model.

Summary by CodeRabbit

  • New Features

    • Text-to-speech now defaults to the s2.1-pro model for streaming, conversion, and WebSocket generation.
    • Added support for selecting s2.1-pro in Text-to-Speech documentation.
    • Added support for recognized model names, including s1, s2-pro, and s2.1-pro.
  • Bug Fixes

    • Improved model validation with warnings for deprecated or unrecognized model names while preserving request compatibility.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@JarodMica, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 28ce0534-6d84-490b-8225-8c770a3f7011

📥 Commits

Reviewing files that changed from the base of the PR and between c7148a5 and 89e5269.

📒 Files selected for processing (5)
  • README.md
  • src/fishaudio/resources/tts.py
  • src/fishaudio/types/shared.py
  • tests/unit/test_tts.py
  • tests/unit/test_tts_realtime.py
📝 Walkthrough

Walkthrough

TTS synchronous and asynchronous methods now default to s2.1-pro. Model typing and validation recognize supported, deprecated, and unknown models. Documentation and tests reflect the updated behavior.

Changes

TTS model update

Layer / File(s) Summary
Model contract and validation
src/fishaudio/types/shared.py, tests/unit/test_tts.py
The Model literal and supported model set include s2.1-pro. Deprecated and unknown models produce warnings, while unknown names remain requestable.
TTS defaults and examples
src/fishaudio/resources/tts.py, tests/unit/test_tts.py, README.md
Synchronous and asynchronous streaming, conversion, and WebSocket methods accept string model names and default to s2.1-pro. Tests and the production usage example reflect the updated model.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding support for the S2.1 Pro model.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/unit/test_tts.py (1)

66-66: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover all changed default paths.

This assertion covers only synchronous stream; add equivalent coverage for synchronous/async convert and both WebSocket methods so future default drift is detected across every changed entry point.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/test_tts.py` at line 66, Add assertions covering the default model
header for synchronous and asynchronous convert methods and both WebSocket
methods, matching the existing synchronous stream assertion in the relevant test
flow. Ensure each changed entry point verifies the default value is “s2.1-pro”
so future default drift is detected consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/fishaudio/types/shared.py`:
- Around line 25-46: Update the model type aliases in shared.py to separate the
supported-model Literal used by SUPPORTED_MODELS from a permissive pass-through
model alias. In tts.py, annotate parameters that only accept supported models
with the known-model alias, while methods that intentionally forward
undocumented or deprecated values should use the permissive alias; keep
warn_if_deprecated_model accepting those runtime values.

---

Nitpick comments:
In `@tests/unit/test_tts.py`:
- Line 66: Add assertions covering the default model header for synchronous and
asynchronous convert methods and both WebSocket methods, matching the existing
synchronous stream assertion in the relevant test flow. Ensure each changed
entry point verifies the default value is “s2.1-pro” so future default drift is
detected consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 527983eb-5505-4a43-bf74-fc02f769518e

📥 Commits

Reviewing files that changed from the base of the PR and between 999c59d and 4304a68.

📒 Files selected for processing (4)
  • README.md
  • src/fishaudio/resources/tts.py
  • src/fishaudio/types/shared.py
  • tests/unit/test_tts.py

Comment thread src/fishaudio/types/shared.py Outdated
@JarodMica
JarodMica force-pushed the fix/s2-1-model-types branch from 4304a68 to 06eb85c Compare July 31, 2026 02:16
@JarodMica JarodMica closed this Jul 31, 2026
@JarodMica
JarodMica force-pushed the fix/s2-1-model-types branch from 06eb85c to 999c59d Compare July 31, 2026 02:19
@JarodMica JarodMica reopened this Jul 31, 2026
Comment thread src/fishaudio/types/shared.py Outdated
DeprecationWarning,
stacklevel=3,
)
elif model not in SUPPORTED_MODELS:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If we can accept string as the model name, we don’t need to alert anything when user enter anything

@Kilerd Kilerd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don’t need to warn for the unknown model name

@JarodMica

Copy link
Copy Markdown
Contributor Author

We don’t need to warn for the unknown model name

Some feedback I got was to warn user if the model passed is different than what is being served, I'll remove this part but it was part of the inspiritation

Update the default model, supported model types, pass-through behavior, documentation, and default-path coverage for s2.1-pro.

AI-Assisted-By: Codex
@JarodMica
JarodMica force-pushed the fix/s2-1-model-types branch from c7148a5 to 89e5269 Compare July 31, 2026 02:45

@Kilerd Kilerd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@leng-yue
leng-yue enabled auto-merge (squash) July 31, 2026 09:40
@leng-yue
leng-yue disabled auto-merge July 31, 2026 09:40
@leng-yue
leng-yue enabled auto-merge (squash) July 31, 2026 09:40
@leng-yue
leng-yue merged commit 4481509 into fishaudio:main Jul 31, 2026
9 checks passed
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/fishaudio/resources/tts.py 95.00% <ø> (ø)
src/fishaudio/types/shared.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants