From 609a43a19165b68955d13564e1392ce569fe35cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 14 Aug 2025 15:12:02 -0700 Subject: [PATCH] FrameProcessor: added processors/next/previous properties --- CHANGELOG.md | 2 ++ src/pipecat/processors/frame_processor.py | 30 +++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 166ceff92..a02e700f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added `FrameProcessor` properties `processors`, `next` and `previous`. + - `ElevenLabsTTSService` now supports additional runtime changes to the `model`, `language`, and `voice_settings` parameters. diff --git a/src/pipecat/processors/frame_processor.py b/src/pipecat/processors/frame_processor.py index 7265c2bee..b03930c67 100644 --- a/src/pipecat/processors/frame_processor.py +++ b/src/pipecat/processors/frame_processor.py @@ -250,6 +250,36 @@ class FrameProcessor(BaseObject): """ return self._name + @property + def processors(self) -> List["FrameProcessor"]: + """Return the list of sub-processors contained within this processor. + + Only compound processors (e.g. pipelines and parallel pipelines) have + sub-processors. Non-compound processors will return an empty list. + + Returns: + The list of sub-processors if this is a compound processor. + """ + return [] + + @property + def next(self) -> Optional["FrameProcessor"]: + """Get the next processor. + + Returns: + The next processor, or None if there's no next processor. + """ + return self._next + + @property + def previous(self) -> Optional["FrameProcessor"]: + """Get the previous processor. + + Returns: + The previous processor, or None if there's no previous processor. + """ + return self._prev + @property def interruptions_allowed(self): """Check if interruptions are allowed for this processor.