diff --git a/src/pipecat/services/anthropic.py b/src/pipecat/services/anthropic.py index bc91e4e16..6a535ef15 100644 --- a/src/pipecat/services/anthropic.py +++ b/src/pipecat/services/anthropic.py @@ -579,7 +579,7 @@ class AnthropicAssistantContextAggregator(LLMAssistantContextAggregator): run_llm = False aggregation = self._aggregation - self._aggregation = "" + self._reset() try: if self._function_call_result: @@ -630,5 +630,8 @@ class AnthropicAssistantContextAggregator(LLMAssistantContextAggregator): if run_llm: await self._user_context_aggregator.push_context_frame() + frame = OpenAILLMContextFrame(self._context) + await self.push_frame(frame) + except Exception as e: logger.error(f"Error processing frame: {e}") diff --git a/src/pipecat/services/openai.py b/src/pipecat/services/openai.py index f0892b9ca..99d2d7497 100644 --- a/src/pipecat/services/openai.py +++ b/src/pipecat/services/openai.py @@ -495,7 +495,7 @@ class OpenAIAssistantContextAggregator(LLMAssistantContextAggregator): run_llm = False aggregation = self._aggregation - self._aggregation = "" + self._reset() try: if self._function_call_result: @@ -531,5 +531,8 @@ class OpenAIAssistantContextAggregator(LLMAssistantContextAggregator): if run_llm: await self._user_context_aggregator.push_context_frame() + frame = OpenAILLMContextFrame(self._context) + await self.push_frame(frame) + except Exception as e: logger.error(f"Error processing frame: {e}") diff --git a/src/pipecat/services/together.py b/src/pipecat/services/together.py index e4068ecfc..935f625ad 100644 --- a/src/pipecat/services/together.py +++ b/src/pipecat/services/together.py @@ -370,7 +370,7 @@ class TogetherAssistantContextAggregator(LLMAssistantContextAggregator): run_llm = False aggregation = self._aggregation - self._aggregation = "" + self._reset() try: if self._function_call_result: @@ -390,5 +390,8 @@ class TogetherAssistantContextAggregator(LLMAssistantContextAggregator): if run_llm: await self._user_context_aggregator.push_messages_frame() + frame = OpenAILLMContextFrame(self._context) + await self.push_frame(frame) + except Exception as e: logger.error(f"Error processing frame: {e}")