Add Cartesia inference STT turn options - #2161
Closed
rosetta-livekit-bot[bot] wants to merge 2 commits into
Closed
Conversation
🦋 Changeset detectedLatest commit: 3a163d7 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 |
tinalenguyen
approved these changes
Jul 29, 2026
Contributor
|
done in #2173 |
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.
Summary
CartesiaOptions@livekit/agentsSource diff coverage
livekit-agents/livekit/agents/inference/stt.pyagents/src/inference/stt.ts. Ported theCartesiaOptionstype additions and updated comments as TypeScript interface fields/JSDoc.No source tests were added or modified in PR #6597, so there were no tests to port.
Validation
pnpm exec prettier --write agents/src/inference/stt.ts .changeset/sharp-cartesia-turns.mdpnpm test agentspassed: 111 test files, 1503 tests passed, 5 skippedpnpm --filter @livekit/agents buildpassedpnpm --filter @livekit/agents lintcompleted with existing warningspnpm buildpassedpnpm lintcompleted with existing warningspnpm --filter @livekit/agents api:checkfailed on existing API Extractor/toolchain issue:export * as ___syntax is not supported yet inagents/dist/index.d.tsRuntime
cue-clivalidation was not run because this port is a type-only inference STT options change and does not modify voice pipeline behavior.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