From 22027a0c22caec36239f374029f8a8f066d86466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Tue, 8 Oct 2024 16:16:58 -0700 Subject: [PATCH] disable preemptive_synthesis by default (#867) --- .changeset/grumpy-gorillas-guess.md | 5 +++++ livekit-agents/livekit/agents/pipeline/pipeline_agent.py | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/grumpy-gorillas-guess.md diff --git a/.changeset/grumpy-gorillas-guess.md b/.changeset/grumpy-gorillas-guess.md new file mode 100644 index 000000000..a9d092673 --- /dev/null +++ b/.changeset/grumpy-gorillas-guess.md @@ -0,0 +1,5 @@ +--- +"livekit-agents": patch +--- + +disable preemptive_synthesis by default diff --git a/livekit-agents/livekit/agents/pipeline/pipeline_agent.py b/livekit-agents/livekit/agents/pipeline/pipeline_agent.py index 2715652f5..13bad4106 100644 --- a/livekit-agents/livekit/agents/pipeline/pipeline_agent.py +++ b/livekit-agents/livekit/agents/pipeline/pipeline_agent.py @@ -140,7 +140,7 @@ def __init__( interrupt_speech_duration: float = 0.5, interrupt_min_words: int = 0, min_endpointing_delay: float = 0.5, - preemptive_synthesis: bool = True, + preemptive_synthesis: bool = False, transcription: AgentTranscriptionOptions = AgentTranscriptionOptions(), before_llm_cb: BeforeLLMCallback = _default_before_llm_cb, before_tts_cb: BeforeTTSCallback = _default_before_tts_cb, @@ -433,6 +433,11 @@ def _on_final_transcript(ev: stt.SpeechEvent) -> None: if not new_transcript: return + logger.debug( + "received user transcript", + extra={"user_transcript": new_transcript}, + ) + self._transcribed_text += ( " " if self._transcribed_text else "" ) + new_transcript @@ -586,7 +591,6 @@ async def _synthesize_answer_task( logger.debug( "synthesizing agent reply", extra={ - "user_transcript": handle.user_question, "speech_id": handle.id, "elapsed": elapsed, },