diff --git a/livekit-agents/livekit/agents/pipeline/pipeline_agent.py b/livekit-agents/livekit/agents/pipeline/pipeline_agent.py index 98d51fa95..3fc7a8204 100644 --- a/livekit-agents/livekit/agents/pipeline/pipeline_agent.py +++ b/livekit-agents/livekit/agents/pipeline/pipeline_agent.py @@ -49,6 +49,7 @@ EventTypes = Literal[ "user_started_speaking", "user_interim_transcript", + "user_final_transcript", "user_stopped_speaking", "agent_started_speaking", "agent_stopped_speaking", @@ -417,6 +418,7 @@ def on(self, event: EventTypes, callback: Callable[[Any], None] | None = None): event: the event to listen to (see EventTypes) - user_started_speaking: the user started speaking - user_interim_transcript: the user transcript was updated + - user_final_transcript: the user transcript was committed - user_stopped_speaking: the user stopped speaking - agent_started_speaking: the agent started speaking - agent_stopped_speaking: the agent stopped speaking @@ -592,6 +594,7 @@ def _on_final_transcript(ev: stt.SpeechEvent) -> None: "received user transcript", extra={"user_transcript": new_transcript}, ) + self.emit("user_final_transcript", new_transcript) self._last_final_transcript_time = time.perf_counter()