Merge pull request #3434 from pipecat-ai/aleix/context-appregator-pair-tuple

context aggregator pair tuple
This commit is contained in:
Aleix Conchillo Flaqué
2026-01-13 14:12:51 -08:00
committed by GitHub
156 changed files with 461 additions and 471 deletions

View File

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