From 0a02c48f24baa90bfd236ae58d1faa24a80c8d66 Mon Sep 17 00:00:00 2001 From: Merlinvt Date: Mon, 16 Dec 2024 20:16:14 +0100 Subject: [PATCH] generate reply synchronously not async --- .../agentchat/contrib/magentic_one/orchestrator_agent.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autogen/agentchat/contrib/magentic_one/orchestrator_agent.py b/autogen/agentchat/contrib/magentic_one/orchestrator_agent.py index 4470e47777..154fe1f930 100644 --- a/autogen/agentchat/contrib/magentic_one/orchestrator_agent.py +++ b/autogen/agentchat/contrib/magentic_one/orchestrator_agent.py @@ -523,13 +523,13 @@ def _select_next_agent(self, task: dict | str) -> Optional[ConversableAgent]: return None - async def a_generate_reply( + def generate_reply( self, messages: Optional[List[Dict[str, Any]]] = None, sender: Optional["Agent"] = None, **kwargs: Any, ) -> Union[str, Dict, None]: - """Asynchronously generate a reply by orchestrating multi-agent task execution. + """Generate a reply by orchestrating multi-agent task execution. This method manages the entire lifecycle of a multi-agent task, including: - Initializing the task @@ -592,7 +592,7 @@ async def a_generate_reply( ) break - response = await next_agent.a_generate_reply(messages=[instructions], sender=self) + response = next_agent.generate_reply(messages=[instructions], sender=self) if isinstance(response, str): response = response