Repository navigation
feat(asr): warn when a transcription is sent without a model - #208
Conversation
A transcription with no model runs on the API default, transcribe-1, which retires on 2026-12-31; after that such requests are served and billed as transcribe-2-pro and transcripts can change. Only a named transcribe-1 warned. A request that carries no model (no argument, no model header in request_options or on the httpx client) now emits a FutureWarning, once per process, with the same text as the other Fish Audio SDKs. Passing any model silences it. The default model, the named-transcribe-1 notice and the requests themselves are unchanged.
…ement The notice said a request without a model runs on 'transcribe-1', which is false for a request sent after 2026-12-31. It now says the request runs on the API's default model, which is 'transcribe-1' until it is retired, and keeps the rest of the common text shared with the other Fish Audio SDKs. The README sentence and the code comment say the same.
…del is none The notice was given once per process through a module flag and a lock. That broke the caller's warning filters: under an "error" filter the first call raised and a retry went through, a call under "ignore" used the notice up, and a forked child could block on a lock held in the parent. It is now a plain FutureWarning, as for a named deprecated model, so the default filter shows it once per calling line, "error" raises on every call before anything is sent, and "ignore" hides only what it covers. The model the request sends is decided as httpx merges it: the argument, then a model header in request_options, then the httpx client's own header, each skipped only when absent. An empty value then means no model. Before, model="" warned only when the client had no model header, although the request sent the same empty header either way.
… means for the notice
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the changes include coverage for warning behavior, model precedence, and async cases.
No open issues 🎉
What changed in this PR
Adds FutureWarning notifications for ASR requests without an explicitly resolved model while preserving existing model-specific warnings.
Changes:
- Detects model precedence across arguments, request options, and client headers.
- Adds sync/async warning behavior and comprehensive tests.
- Documents the warning and model-selection guidance.
| File | Description |
|---|---|
| tests/unit/test_deprecated_models.py | Tests warning behavior, filtering, precedence, and async transcription cases. |
| src/fishaudio/types/shared.py | Defines the no-model warning message and helper behavior. |
| src/fishaudio/resources/asr.py | Resolves the effective model and emits warnings for model-less transcription requests. |
| README.md | Documents ASR default-model warnings and model-selection guidance. |
Review effort: Lite
A transcription that names no model runs on the API's default model:
transcribe-1until it is retired on December 31, 2026. After that date, such requests are served and billed astranscribe-2-pro, and transcripts can change (speaker markers, audio-event tags). Until now only a request that namedtranscribe-1was warned.asr.transcribe()with no model (no argument, nomodelheader inrequest_optionsor on your httpx client)FutureWarning: "No speech-to-text model was specified, so this request runs on the API's default model. The default is 'transcribe-1' until it is retired on December 31, 2026. After that date, requests without a model are served by 'transcribe-2-pro' and billed as 'transcribe-2-pro', and transcripts can include speaker markers and audio-event tags. Specify a model to choose it yourself, for example 'transcribe-2-pro'."asr.transcribe()with a modelasr.transcribe(model="transcribe-1")FutureWarningwarningsfilters like the SDK's other deprecation warnings: with the default filters it is shown once per calling line;ignorehides it;errorraises it on every such call.modelargument, then amodelheader inrequest_options, then one on your httpx client. An empty value counts as no model.asr.stream_websocket(), which sendstranscribe-stream-1) are unchanged. The text is the same in the other Fish Audio SDKs.To silence it: pass a model, for example
model="transcribe-2-pro", or set amodelheader. Write the model ID exactly.Known limit: a model that only an httpx request hook or auth flow adds is not seen, so such a request still gets the warning; with warnings turned into errors that call raises, so pass
modelin the call.Verification: new tests fail without the change: sync and async warn at the caller's line with the exact text; under an
errorfilter the first and the second call raise and nothing is sent; a call after anignoreblock still warns;model=""cases; a namedtranscribe-1keeps its own warning; a model given as the argument, inrequest_optionsor on the httpx client silences it. Unit suite on Python 3.9 (httpx-ws 0.7.2) and 3.12 (httpx-ws 0.10.0); lint, format and type check clean. Against the live API: a warning on a call without a model, none with a model, async the same.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.