diff --git a/CHANGELOG.md b/CHANGELOG.md index e4ef1e019..62c8f4d84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- `HeartbeatFrame`s are now control frames. This will make it easier to detect + pipeline freezes. Previously, heartbeat frames were system frames which meant + they were not get queued with other frames, making it difficult to detect + pipeline stalls. + - Updated `OpenAIRealtimeBetaLLMService` to accept `language` in the `InputAudioTranscription` class for all models. diff --git a/src/pipecat/frames/frames.py b/src/pipecat/frames/frames.py index ec368789d..82626654a 100644 --- a/src/pipecat/frames/frames.py +++ b/src/pipecat/frames/frames.py @@ -485,16 +485,6 @@ class FatalErrorFrame(ErrorFrame): fatal: bool = field(default=True, init=False) -@dataclass -class HeartbeatFrame(SystemFrame): - """This frame is used by the pipeline task as a mechanism to know if the - pipeline is running properly. - - """ - - timestamp: int - - @dataclass class EndTaskFrame(SystemFrame): """This is used to notify the pipeline task that the pipeline should be @@ -877,6 +867,16 @@ class StopFrame(ControlFrame): pass +@dataclass +class HeartbeatFrame(ControlFrame): + """This frame is used by the pipeline task as a mechanism to know if the + pipeline is running properly. + + """ + + timestamp: int + + @dataclass class FrameProcessorPauseFrame(ControlFrame): """This processor is used to pause frame processing for the given diff --git a/src/pipecat/pipeline/task.py b/src/pipecat/pipeline/task.py index 3f13e7eb2..7a2c4fd36 100644 --- a/src/pipecat/pipeline/task.py +++ b/src/pipecat/pipeline/task.py @@ -41,7 +41,7 @@ from pipecat.utils.tracing.setup import is_tracing_available from pipecat.utils.tracing.turn_trace_observer import TurnTraceObserver HEARTBEAT_SECONDS = 1.0 -HEARTBEAT_MONITOR_SECONDS = HEARTBEAT_SECONDS * 5 +HEARTBEAT_MONITOR_SECONDS = HEARTBEAT_SECONDS * 10 class PipelineParams(BaseModel):