fix(workflow): track fixed speech at transport output
This commit is contained in:
@@ -3,14 +3,17 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Awaitable
|
||||
from typing import Any
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from pipecat.frames.frames import OutputTransportMessageUrgentFrame, TTSSpeakFrame
|
||||
from pipecat.utils.time import time_now_iso8601
|
||||
|
||||
from services.brains.base import BrainRuntime
|
||||
from services.pipecat.call_lifecycle import playback_marker_for
|
||||
from services.runtime_variables import DynamicVariableStore
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from services.brains.base import BrainRuntime
|
||||
|
||||
|
||||
FIXED_SPEECH_CONTEXT_MARKER = "[会话事实:以下固定消息已向用户播报]"
|
||||
|
||||
@@ -79,6 +82,10 @@ class FixedSpeechOutput:
|
||||
await self._runtime.queue_frame(
|
||||
TTSSpeakFrame(content, append_to_context=False)
|
||||
)
|
||||
playback_marker = playback_marker_for(playback_completion)
|
||||
if playback_marker is not None:
|
||||
await self._runtime.queue_frame(playback_marker)
|
||||
playback_marker.completion.mark_queued()
|
||||
return playback_completion
|
||||
|
||||
async def emit(self, message: dict[str, Any]) -> None:
|
||||
|
||||
Reference in New Issue
Block a user