Skip to content

feat(agent-py): switch to the audio turn detector - #42

Merged
codeSTACKr merged 1 commit into
mainfrom
feat/audio-turn-detector
Nov 13, 2026
Merged

codeSTACKr merged 1 commit into
mainfrom
feat/audio-turn-detector

Conversation

@codeSTACKr

Copy link
Copy Markdown
Contributor

What

Mirrors livekit-examples/mongodb-hacker-starter#57:

  • Replaces the deprecated text turn detector (MultilingualModel) with LiveKit's audio turn detector: TurnHandlingOptions(turn_detection=inference.TurnDetector(), preemptive_generation={"enabled": True}). This also moves the deprecated turn_detection= / preemptive_generation= AgentSession kwargs into TurnHandlingOptions.
  • AgentSession supplies the VAD, so Silero VAD, prewarm and the silero / turn-detector extras are dropped. The lock loses onnxruntime, transformers, huggingface-hub and friends.
  • livekit-agents~=1.8 (was ==1.8.12), livekit-plugins-ai-coustics~=0.3. 1.8.12 is still the latest.
  • download-files runs via uv run -m livekit.agents download-files in the Dockerfile (before COPY . .), the root agent:py:download-files script and the agent README. The agent-script form prints a deprecation notice.
  • The Moss tests use longer placeholder LiveKit credentials, so PyJWT no longer warns about a short HMAC key.
  • dev script unchanged (separate task).

Tested

Python 3.14: uv sync --locked, ruff check/format, pytest (3 passed, 3 key-dependent skipped, 0 warnings with -W default), src/agent.py --help and -m livekit.agents download-files print no deprecation warnings. An AgentSession built with the new options constructs, with inference.TurnDetector and the SDK-supplied VAD. CI builds the Docker image and imports Moss in it.

🤖 Generated with Claude Code

https://claude.ai/code/session_013EcAtRg8aYia9VZrTAZ4Av

- Replace the deprecated text turn detector (MultilingualModel) with
  LiveKit's audio turn detector via
  TurnHandlingOptions(turn_detection=inference.TurnDetector(), ...).
  AgentSession supplies the VAD, so Silero VAD and prewarm are dropped,
  as are the turn-detector/silero extras (removes onnxruntime,
  transformers and huggingface-hub from the lock).
- Move the deprecated AgentSession turn_detection/preemptive_generation
  kwargs into TurnHandlingOptions.
- livekit-agents ~=1.8 (was ==1.8.12), livekit-plugins-ai-coustics ~=0.3.
- download-files runs via `uv run -m livekit.agents download-files`
  (Dockerfile, root script, README); the agent-script form is deprecated.
- Longer placeholder LiveKit credentials in the Moss tests so PyJWT
  stops warning about a short HMAC key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EcAtRg8aYia9VZrTAZ4Av
@codeSTACKr

Copy link
Copy Markdown
Contributor Author

Validated locally (see description) and CI green, including the Docker build (-m livekit.agents download-files) and the in-container Moss import + --help: https://github.com/livekit-examples/moss-hacker-starter/actions/runs/43499575968

@codeSTACKr
codeSTACKr merged commit 2417c1b into main Nov 13, 2026
7 checks passed
@codeSTACKr
codeSTACKr deleted the feat/audio-turn-detector branch November 13, 2026 20:15
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