Skip to content

(xai stt): expose vad_threshold, smart_turn, smart_turn_timeout, and keyterm params - #6587

Merged
tinalenguyen merged 1 commit into
livekit:mainfrom
ajayarora1235:aa/xai-stt-expose-turn-vad-keyterm
Jul 29, 2026
Merged

(xai stt): expose vad_threshold, smart_turn, smart_turn_timeout, and keyterm params#6587
tinalenguyen merged 1 commit into
livekit:mainfrom
ajayarora1235:aa/xai-stt-expose-turn-vad-keyterm

Conversation

@ajayarora1235

@ajayarora1235 ajayarora1235 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #6588.

Follows the pattern of #5493 (which exposed endpointing): adds the remaining xAI STT websocket parameters documented at https://docs.x.ai/developers/model-capabilities/audio/speech-to-text as constructor args / update_options on xai.STT:

  • vad_threshold (0.0–1.0) — built-in VAD sensitivity; xAI's websocket default is 0.08
  • smart_turn (0.0–1.0) — confidence threshold for xAI's ML end-of-turn ("Smart Turn") prediction
  • smart_turn_timeout (1–5000 ms) — silence backstop when Smart Turn predicts the speaker is continuing
  • keyterm (list, max 100 terms) — vocabulary biasing; sent as repeated query params, so the websocket params dict became a list of pairs

All four are NotGivenOr and omitted from the query string when unset, so existing behavior is unchanged — the default connection sends the identical query as before. Verified with ruff check / ruff format; param names/ranges are taken from the xAI docs above.

Motivation: these are the main turn-taking tunables for using xai/stt-1 with turn_detection="stt" in an AgentSession — today the plugin (and the Inference gateway's xai.ExtraSettings, which rejects these keys) only exposes endpointing, so smart-turn thresholds and keyword boosting are unreachable without patching the plugin.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ajayarora1235
ajayarora1235 requested a review from a team as a code owner July 28, 2026 17:13
@CLAassistant

CLAassistant commented Jul 28, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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

thanks for the PR!

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.

xAI STT: expose smart_turn, vad_threshold, and keyterm parameters

3 participants