Repository navigation
feat(agent-py): switch to the audio turn detector - #42
Merged
Merged
Conversation
- 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
Contributor
Author
|
Validated locally (see description) and CI green, including the Docker build ( |
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.
What
Mirrors livekit-examples/mongodb-hacker-starter#57:
MultilingualModel) with LiveKit's audio turn detector:TurnHandlingOptions(turn_detection=inference.TurnDetector(), preemptive_generation={"enabled": True}). This also moves the deprecatedturn_detection=/preemptive_generation=AgentSessionkwargs intoTurnHandlingOptions.AgentSessionsupplies the VAD, so Silero VAD,prewarmand thesilero/turn-detectorextras 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.uv run -m livekit.agents download-filesin the Dockerfile (beforeCOPY . .), the rootagent:py:download-filesscript and the agent README. The agent-script form prints a deprecation notice.devscript 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 --helpand-m livekit.agents download-filesprint no deprecation warnings. AnAgentSessionbuilt with the new options constructs, withinference.TurnDetectorand the SDK-supplied VAD. CI builds the Docker image and imports Moss in it.🤖 Generated with Claude Code
https://claude.ai/code/session_013EcAtRg8aYia9VZrTAZ4Av