crooked-dawn-90821
11/26/2025, 4:45 PMtall-airline-16756
11/26/2025, 4:45 PMtall-airline-16756
11/26/2025, 4:45 PMon_user_turn_completed, check the recognized message length (characters or words), and raise StopResponse() when the utterance is too short.
Example (Python):
from livekit import agents
async def on_user_turn_completed(
self,
*,
turn_ctx: agents.llm.ChatContext,
new_message: agents.ChatMessage,
):
# discard utterances shorter than 3 characters
if len(new_message.text_content) < 3:
raise agents.voice.StopResponse()
If you prefer word-based filtering, replace the length check with len(new_message.text_content.split()) < N. Would you like a variant for your language or a JavaScript example?
Sources: Pipeline nodes and hooks | LiveKit docs