feat(inference): type Cartesia turn-detection params - #2173
Merged
Conversation
🦋 Changeset detectedLatest commit: 2abb937 The changes in this PR will be included in the next version bump. This PR includes changesets to release 39 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
u9g
approved these changes
Jul 30, 2026
Merged
This was referenced Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports livekit/agents#6597 by exposing the Cartesia turn-detection gateway parameters through inference STT model option typing. Also marks the existing volume and silence options as Ink Whisper-only.
Adds a minor changeset for the new public API typing.
Source diff coverage
livekit-agents/livekit/agents/inference/stt.py: adapted toagents/src/inference/stt.ts. Added all five Cartesia turn-detection fields with the same types, ranges, defaults, model scope, and gateway-validation context. Python comments were adapted to TypeScript comments/JSDoc; gateway snake_case field names were retained verbatim because inference passes these options through unchanged.Validation
pnpm test agents(1,505 passed, 5 skipped)pnpm --filter @livekit/agents buildpnpm --filter @livekit/agents typecheckpnpm --filter @livekit/agents lint(passes with existing warnings)pnpm exec prettier --check "agents/src/inference/stt.ts" ".changeset/type-cartesia-turn-detection.md"Ported from livekit/agents#6597
Original PR description
Companion to #6594 (which exposed these on the direct plugin): the Inference gateway already accepts and validates Cartesia's turn-detection tuning params via
extra_kwargs— they're just missing from theCartesiaOptionsTypedDict, so users can't discover them.Verified live against the gateway today:
extra_kwargs={"turn_start_threshold": 0.6}oncartesia/ink-2→ session created and runs normally.extra_kwargs={"turn_start_threshold": 2.0}→ session creation fails withcartesiaturns: extra settings validation failed: turn_start_threshold must be <= 0.9, got 2— i.e. the gateway's cartesia-turns adapter knows these params and enforces Cartesia's documented ranges.This PR only adds the keys to the TypedDict (typing/discoverability —
extra_kwargsalready passes them through verbatim) and annotates the two existing keys as ink-whisper-only, per Cartesia's API reference. Ranges/defaults from https://docs.cartesia.ai/api-reference/stt/turns/websocket.Verified with
ruff check/ruff format.🤖 Generated with Claude Code