feat(vad): set default vad in agent session#5812
Open
chenghao-mou wants to merge 1 commit into
Open
Conversation
theomonnom
reviewed
May 22, 2026
|
|
||
| def _build_default_vad() -> vad.VAD: | ||
| instance = inference.VAD(model="silero") | ||
| instance._is_default = True |
Member
There was a problem hiding this comment.
Should we create a separate field? Like one inside the session itself? self._using_default_vad = True
Member
Author
There was a problem hiding this comment.
I thought about that, but then we need to pass extra flag to activity for resolution or audio recognition like in update_vad.
theomonnom
approved these changes
May 22, 2026
15d36dd to
5644401
Compare
0526efb to
122cd9c
Compare
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.
AgentSessionnow provisions a bundled silero VAD automatically. Existing call-site behaviour is preserved via anis_defaultmarker on the VAD instance — the framework-supplied default is transparent to every code path that previously cared about "user configured a VAD."Before
…or, in examples using the prewarm pattern:
After
What changes (and what doesn't)
AgentSession()with novad=inference.VAD(model="silero")withis_default=TrueAgentSession(vad=None)AgentSession(vad=my_vad)is_default=FalseRealtimeModelwith server-side turn detectionturn_detection="vad"/AudioTurnDetectoropt-insmode = "vad"when server-side turn detection is offspeaking=payload type and_last_speaking_timesourceThe marker is exposed as a read-only
vad.VAD.is_defaultproperty on the base class, so plugin-supplied VADs inheritFalseautomatically.