From 56c52c2cf21feeb5d658a6a2967e1a29dcb5fbe5 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Wed, 6 Aug 2025 15:05:39 -0400 Subject: [PATCH] Deprecate `LLMUserResponseAggregator` and `LLMAssistantResponseAggregator`, which depend on the now-deprecated `LLMMessagesFrame`. --- .../processors/aggregators/llm_response.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/pipecat/processors/aggregators/llm_response.py b/src/pipecat/processors/aggregators/llm_response.py index 3b1215473..a842f73cd 100644 --- a/src/pipecat/processors/aggregators/llm_response.py +++ b/src/pipecat/processors/aggregators/llm_response.py @@ -12,6 +12,7 @@ LLM processing, and text-to-speech components in conversational AI pipelines. """ import asyncio +import warnings from abc import abstractmethod from dataclasses import dataclass from typing import Dict, List, Literal, Optional, Set @@ -994,6 +995,10 @@ class LLMAssistantContextAggregator(LLMContextResponseAggregator): class LLMUserResponseAggregator(LLMUserContextAggregator): """User response aggregator that outputs LLMMessagesFrame instead of context frames. + .. deprecated:: 0.0.78 + This class is deprecated and will be removed in a future version. + Use `LLMUserContextAggregator` or another LLM-specific subclass instead. + This aggregator extends LLMUserContextAggregator but pushes LLMMessagesFrame objects downstream instead of OpenAILLMContextFrame objects. This is useful when you need message-based output rather than context-based output. @@ -1008,11 +1013,21 @@ class LLMUserResponseAggregator(LLMUserContextAggregator): ): """Initialize the user response aggregator. + .. deprecated:: 0.0.78 + This class is deprecated and will be removed in a future version. + Use `LLMUserContextAggregator` or another LLM-specific subclass instead. + Args: messages: Initial messages for the conversation context. params: Configuration parameters for aggregation behavior. **kwargs: Additional arguments passed to parent class. """ + warnings.warn( + "LLMUserResponseAggregator is deprecated and will be removed in a future version. " + "Use LLMUserContextAggregator or another LLM-specific subclass instead.", + DeprecationWarning, + stacklevel=2, + ) super().__init__(context=OpenAILLMContext(messages), params=params, **kwargs) async def _process_aggregation(self): @@ -1027,6 +1042,10 @@ class LLMUserResponseAggregator(LLMUserContextAggregator): class LLMAssistantResponseAggregator(LLMAssistantContextAggregator): """Assistant response aggregator that outputs LLMMessagesFrame instead of context frames. + .. deprecated:: 0.0.78 + This class is deprecated and will be removed in a future version. + Use `LLMAssistantContextAggregator` or another LLM-specific subclass instead. + This aggregator extends LLMAssistantContextAggregator but pushes LLMMessagesFrame objects downstream instead of OpenAILLMContextFrame objects. This is useful when you need message-based output rather than context-based output. @@ -1041,11 +1060,21 @@ class LLMAssistantResponseAggregator(LLMAssistantContextAggregator): ): """Initialize the assistant response aggregator. + .. deprecated:: 0.0.78 + This class is deprecated and will be removed in a future version. + Use `LLMAssistantContextAggregator` or another LLM-specific subclass instead. + Args: messages: Initial messages for the conversation context. params: Configuration parameters for aggregation behavior. **kwargs: Additional arguments passed to parent class. """ + warnings.warn( + "LLMAssistantResponseAggregator is deprecated and will be removed in a future version. " + "Use LLMAssistantContextAggregator or another LLM-specific subclass instead.", + DeprecationWarning, + stacklevel=2, + ) super().__init__(context=OpenAILLMContext(messages), params=params, **kwargs) async def push_aggregation(self):