Merge pull request #2675 from pipecat-ai/pk/service-switcher-logic-simplification
Simplify a bit of logic in `ServiceSwitcher`
This commit is contained in:
@@ -169,11 +169,4 @@ class ServiceSwitcher(ParallelPipeline, Generic[StrategyType]):
|
|||||||
service_switcher_filter_frame = ServiceSwitcher.ServiceSwitcherFilterFrame(
|
service_switcher_filter_frame = ServiceSwitcher.ServiceSwitcherFilterFrame(
|
||||||
active_service=self.strategy.active_service
|
active_service=self.strategy.active_service
|
||||||
)
|
)
|
||||||
# Hack: we need access ParallelPipeline internals here to queue the
|
await super().process_frame(service_switcher_filter_frame, direction)
|
||||||
# frame in each of the pipelines.
|
|
||||||
# Why not just call super().process_frame(service_switcher_filter_frame, direction),
|
|
||||||
# you ask? Because that would also send this internal-only frame
|
|
||||||
# down the "main" pipeline instead of only down the individual
|
|
||||||
# branches of the parallel pipeline, which we want to avoid.
|
|
||||||
for p in self._pipelines:
|
|
||||||
await p.queue_frame(service_switcher_filter_frame, direction)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user