Skip to content

Commit

Permalink
Tweak of the SwarmAgent __str__ to indicate transition
Browse files Browse the repository at this point in the history
  • Loading branch information
marklysze committed Nov 19, 2024
1 parent d3e2649 commit fbe44ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions autogen/agentchat/contrib/swarm_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def _set_to_tool_execution(self, context_variables: Optional[Dict[str, Any]] = N
self.register_reply([Agent, None], SwarmAgent.generate_swarm_tool_reply)

def __str__(self):
return f"SwarmAgent: {self.name}"
return f"SwarmAgent --> {self.name}"

def register_hand_off(
self,
Expand All @@ -274,9 +274,9 @@ def transfer_to_agent_name() -> SwarmAgent:
self.after_work = transit
elif isinstance(transit, ON_CONDITION):

def make_transfer_function(current_transit): # Create closure with current loop transit value
# Create closure with current loop transit value
def make_transfer_function(current_transit):
def transfer_to_agent() -> "SwarmAgent":
print(f"Transferring to {current_transit.agent.name}, type of transit: {type(current_transit)}")
return current_transit.agent

return transfer_to_agent
Expand Down

0 comments on commit fbe44ea

Please sign in to comment.