Skip to content

feat(inference): type Cartesia turn-detection params - #2173

Merged
u9g merged 1 commit into
mainfrom
prepay-champion-salaried
Jul 30, 2026
Merged

feat(inference): type Cartesia turn-detection params#2173
u9g merged 1 commit into
mainfrom
prepay-champion-salaried

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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 to agents/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.
  • Source tests: not applicable. The authoritative source PR does not add or modify tests.
  • Source infrastructure: not applicable. The authoritative source PR is typing-only and relies on the gateway pass-through already present in both SDKs.

Validation

  • pnpm test agents (1,505 passed, 5 skipped)
  • pnpm --filter @livekit/agents build
  • pnpm --filter @livekit/agents typecheck
  • pnpm --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 the CartesiaOptions TypedDict, so users can't discover them.

Verified live against the gateway today:

  • extra_kwargs={"turn_start_threshold": 0.6} on cartesia/ink-2 → session created and runs normally.
  • extra_kwargs={"turn_start_threshold": 2.0} → session creation fails with cartesiaturns: 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_kwargs already 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

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from a team as a code owner July 30, 2026 14:24
@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2abb937

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 39 packages
Name Type
@livekit/agents Major
@livekit/agents-plugin-anam Major
@livekit/agents-plugin-anthropic Major
@livekit/agents-plugin-assemblyai Major
@livekit/agents-plugin-azure Major
@livekit/agents-plugin-baseten Major
@livekit/agents-plugin-bey Major
@livekit/agents-plugin-cartesia Major
@livekit/agents-plugin-cerebras Major
@livekit/agents-plugin-deepgram Major
@livekit/agents-plugin-did Major
@livekit/agents-plugin-elevenlabs Major
@livekit/agents-plugin-fishaudio Major
@livekit/agents-plugin-google Major
@livekit/agents-plugin-hedra Major
@livekit/agents-plugin-hume Major
@livekit/agents-plugin-inworld Major
@livekit/agents-plugin-krisp Major
@livekit/agents-plugin-lemonslice Major
@livekit/agents-plugin-liveavatar Major
@livekit/agents-plugin-livekit Major
@livekit/agents-plugin-minimax Major
@livekit/agents-plugin-mistral Major
@livekit/agents-plugin-mistralai Major
@livekit/agents-plugin-neuphonic Major
@livekit/agents-plugin-openai Major
@livekit/agents-plugin-perplexity Major
@livekit/agents-plugin-phonic Major
@livekit/agents-plugin-protoface Major
@livekit/agents-plugin-resemble Major
@livekit/agents-plugin-rime Major
@livekit/agents-plugin-runway Major
@livekit/agents-plugin-sarvam Major
@livekit/agents-plugin-silero Major
@livekit/agents-plugin-soniox Major
@livekit/agents-plugin-tavus Major
@livekit/agents-plugins-test Major
@livekit/agents-plugin-trugen Major
@livekit/agents-plugin-xai Major

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

@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 potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@u9g
u9g merged commit f7e9c0c into main Jul 30, 2026
6 checks passed
@u9g
u9g deleted the prepay-champion-salaried branch July 30, 2026 17:44
@github-actions github-actions Bot mentioned this pull request Jul 30, 2026
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.

1 participant