fix: interrupt message speech on confirmation
This commit is contained in:
@@ -19,6 +19,7 @@ from pipecat.flows import (
|
||||
NodeConfig,
|
||||
)
|
||||
from pipecat.frames.frames import (
|
||||
InterruptionFrame,
|
||||
LLMRunFrame,
|
||||
LLMUpdateSettingsFrame,
|
||||
OutputTransportMessageUrgentFrame,
|
||||
@@ -1084,6 +1085,14 @@ class WorkflowBrain(BaseBrain):
|
||||
),
|
||||
)
|
||||
if result.succeeded:
|
||||
if (
|
||||
completion_policy == MESSAGE_CONFIRMATION
|
||||
and result.action == "confirmed"
|
||||
):
|
||||
# The client-tool result closes the confirmation gate, while
|
||||
# InterruptionFrame closes any speech still owned by this
|
||||
# Message before the next node can enqueue new output.
|
||||
await runtime.queue_frame(InterruptionFrame())
|
||||
await self._emit_trace(
|
||||
"message_completed",
|
||||
nodeId=node_id,
|
||||
|
||||
Reference in New Issue
Block a user