Skip to content

Commit 46b4f9f

Browse files
authored
Merge pull request pipecat-ai#3413 from pipecat-ai/aleix/fix-assistant-thought-aggregation
LLMAssistantAggregator: reset aggregation after adding the thought, not before
2 parents 2f429a2 + ec20d72 commit 46b4f9f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/pipecat/processors/aggregators/llm_response_universal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,6 @@ async def _handle_thought_end(self, frame: LLMThoughtEndFrame):
950950
return
951951

952952
thought = concatenate_aggregated_text(self._thought_aggregation)
953-
await self._reset_thought_aggregation()
954953

955954
if self._thought_append_to_context:
956955
llm = self._thought_llm
@@ -966,6 +965,9 @@ async def _handle_thought_end(self, frame: LLMThoughtEndFrame):
966965
)
967966

968967
message = AssistantThoughtMessage(content=thought, timestamp=self._thought_start_time)
968+
969+
await self._reset_thought_aggregation()
970+
969971
await self._call_event_handler("on_assistant_thought", message)
970972

971973
def _context_updated_task_finished(self, task: asyncio.Task):

0 commit comments

Comments
 (0)