From 1ab3bf2ef6a5579f766f6fdab1a03b5fc3b0f452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Tue, 13 Jan 2026 13:40:55 -0800 Subject: [PATCH] LLMContextAggregatorPair: instances can now return a tuple --- .../processors/aggregators/llm_response_universal.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pipecat/processors/aggregators/llm_response_universal.py b/src/pipecat/processors/aggregators/llm_response_universal.py index 901e5c62c..85050e6d0 100644 --- a/src/pipecat/processors/aggregators/llm_response_universal.py +++ b/src/pipecat/processors/aggregators/llm_response_universal.py @@ -1052,3 +1052,15 @@ class LLMContextAggregatorPair: The assistant context aggregator instance. """ return self._assistant + + def __iter__(self): + """Allow tuple unpacking of the aggregator pair. + + This enables both usage patterns:: + pair = LLMContextAggregatorPair(context) # Returns the instance + user, assistant = LLMContextAggregatorPair(context) # Unpacks into tuple + + Yields: + The user aggregator, then the assistant aggregator. + """ + return iter((self._user, self._assistant))