fix(voice): wire configured STT provider#841
Conversation
WalkthroughChangesSTT configuration
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Pull request overview
This PR wires the documented scenario.configure(stt=...) public API to the existing global STT provider mechanism so users can actually install a custom speech-to-text provider via configuration.
Changes:
- Add an
sttparameter toScenarioConfig.configure()and forward it toscenario.voice.stt.set_stt_provider(...)when provided. - Add a regression test ensuring
scenario.configure(stt=...)updates the provider and that subsequentconfigure()calls withoutsttdo not reset it.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/scenario/config/scenario.py | Accepts stt in ScenarioConfig.configure() and applies it to the voice STT provider. |
| python/tests/voice/test_stt.py | Adds regression coverage for scenario.configure(stt=...) behavior and provider persistence across later config calls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if stt is not None: | ||
| from ..voice.stt import set_stt_provider | ||
|
|
||
| set_stt_provider(stt) |
Why
scenario.configure(stt=...)is documented, but it currently raises aTypeErrorbecauseconfigure()does not acceptstt. This connects that option to the existingset_stt_providerfunction.Closes #743
What changed
sttargument toScenarioConfig.configure().sttis supplied, so later config calls do not reset it.configure()to avoid a circular import.Test plan
test_configure_sets_stt_provider. It fails onmainwith the reportedTypeErrorand passes with this fix.uv run --frozen pytest tests/voice/test_stt.py -q(8 passed)uv run --frozen pytest tests/ -q -m "not integration"(1,155 passed, 10 skipped, 35 deselected, 2 rerun)uv run --frozen pyright .(0 errors)uvx black --check scenario/config/scenario.py tests/voice/test_stt.pyuvx isort --profile black --check-only scenario/config/scenario.py tests/voice/test_stt.pyHow I can prove I was successful
There is no UI or playable artifact for this change. The regression test calls the public API, checks that the supplied provider becomes active, then calls
configure()withoutsttand checks that the provider stays active.