From e0eaa15b144546851c5d9cd9786b405c32e0910c Mon Sep 17 00:00:00 2001 From: Yiran Wu <32823396+kevin666aa@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:41:28 +0800 Subject: [PATCH] add swarm manager option --- autogen/agentchat/contrib/swarm_agent.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autogen/agentchat/contrib/swarm_agent.py b/autogen/agentchat/contrib/swarm_agent.py index c525c53db3..cb1e9b9b99 100644 --- a/autogen/agentchat/contrib/swarm_agent.py +++ b/autogen/agentchat/contrib/swarm_agent.py @@ -32,6 +32,7 @@ class AfterWorkOption(Enum): TERMINATE = "TERMINATE" REVERT_TO_USER = "REVERT_TO_USER" STAY = "STAY" + SWARM_MANAGER = "SWARM_MANAGER" @dataclass @@ -209,6 +210,8 @@ def determine_next_agent(last_speaker: SwarmAgent, groupchat: GroupChat): return user_agent elif tmp_after_work == AfterWorkOption.STAY: return last_speaker + elif tmp_after_work == AfterWorkOption.SWARM_MANAGER: + return "auto" elif isinstance(tmp_after_work, Callable): return tmp_after_work(last_speaker, groupchat.messages, groupchat, context_variables) else: