Skip to content

fix(voice): wire configured STT provider#841

Draft
C0deRatoR wants to merge 1 commit into
langwatch:mainfrom
C0deRatoR:fix/configure-stt-provider
Draft

fix(voice): wire configured STT provider#841
C0deRatoR wants to merge 1 commit into
langwatch:mainfrom
C0deRatoR:fix/configure-stt-provider

Conversation

@C0deRatoR

@C0deRatoR C0deRatoR commented Jul 23, 2026

Copy link
Copy Markdown

Why

scenario.configure(stt=...) is documented, but it currently raises a TypeError because configure() does not accept stt. This connects that option to the existing set_stt_provider function.

Closes #743

What changed

  • Added an optional stt argument to ScenarioConfig.configure().
  • The provider is updated only when stt is supplied, so later config calls do not reset it.
  • The setter is imported inside configure() to avoid a circular import.

Test plan

  • Added test_configure_sets_stt_provider. It fails on main with the reported TypeError and 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.py
  • uvx isort --profile black --check-only scenario/config/scenario.py tests/voice/test_stt.py

How 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() without stt and checks that the provider stays active.

Copilot AI review requested due to automatic review settings July 23, 2026 12:47
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Changes

STT configuration

Layer / File(s) Summary
Configure STT provider
python/scenario/config/scenario.py
ScenarioConfig.configure accepts an optional typed STT provider, documents it, and applies it through set_stt_provider.
Validate provider persistence
python/tests/voice/test_stt.py
Adds coverage confirming STT configuration works and remains unchanged after model-only configuration, with test state restoration.

Suggested reviewers: copilot

Poem

A rabbit configures speech with care,
Hop-hop, the provider is waiting there.
Models may change, but STT stays true,
Tests guard the setting as rabbits do.
Ears perk up—voice flows anew!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR wires scenario.configure(stt=...) to set_stt_provider and adds a regression test, satisfying #743.
Out of Scope Changes check ✅ Passed The changes stay focused on STT configuration wiring and its regression test; no unrelated edits are apparent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly matches the main change: wiring the configured STT provider for voice scenarios.
Description check ✅ Passed The description is directly related to the changeset and accurately summarizes the API fix and tests.
✨ 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.

@C0deRatoR

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI 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.

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 stt parameter to ScenarioConfig.configure() and forward it to scenario.voice.stt.set_stt_provider(...) when provided.
  • Add a regression test ensuring scenario.configure(stt=...) updates the provider and that subsequent configure() calls without stt do 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.

Comment on lines +134 to +137
if stt is not None:
from ..voice.stt import set_stt_provider

set_stt_provider(stt)
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.

fix(voice): scenario.configure(stt=...) is exported but wired to nothing

2 participants