From ac70fbba210260c1b87fce0d9436c8b2ef1741e5 Mon Sep 17 00:00:00 2001 From: Leela Karthik Uttarkar Date: Thu, 5 Feb 2026 23:43:18 +0530 Subject: [PATCH] Integrate clean_conversation in response handling --- .../agent_framework_orchestrations/_group_chat.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/packages/orchestrations/agent_framework_orchestrations/_group_chat.py b/python/packages/orchestrations/agent_framework_orchestrations/_group_chat.py index 5fb5d9db17..66d893eae9 100644 --- a/python/packages/orchestrations/agent_framework_orchestrations/_group_chat.py +++ b/python/packages/orchestrations/agent_framework_orchestrations/_group_chat.py @@ -47,6 +47,7 @@ from agent_framework._workflows._workflow import Workflow from agent_framework._workflows._workflow_builder import WorkflowBuilder from agent_framework._workflows._workflow_context import WorkflowContext +from ._orchestrator_helpers import clean_conversation from pydantic import BaseModel, Field from typing_extensions import Never @@ -192,6 +193,7 @@ async def _handle_response( ) -> None: """Handle a participant response.""" messages = self._process_participant_response(response) + messages = clean_conversation(messages) self._append_messages(messages) if await self._check_terminate_and_yield(cast(WorkflowContext[Never, list[ChatMessage]], ctx)): @@ -359,6 +361,7 @@ async def _handle_response( ) -> None: """Handle a participant response.""" messages = self._process_participant_response(response) + messages = clean_conversation(messages) self._append_messages(messages) if await self._check_terminate_and_yield(cast(WorkflowContext[Never, list[ChatMessage]], ctx)): return