Skip to content

Commit

Permalink
add swarm manager option
Browse files Browse the repository at this point in the history
  • Loading branch information
yiranwu0 committed Dec 16, 2024
1 parent 190a93d commit e0eaa15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions autogen/agentchat/contrib/swarm_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class AfterWorkOption(Enum):
TERMINATE = "TERMINATE"
REVERT_TO_USER = "REVERT_TO_USER"
STAY = "STAY"
SWARM_MANAGER = "SWARM_MANAGER"


@dataclass
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e0eaa15

Please sign in to comment.