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))