Skip to content

register_swarm

autogen.agentchat.realtime.experimental.register_swarm #

register_swarm(*, realtime_agent, initial_agent, agents, system_message=None, question_message=None)

Create a SwarmableRealtimeAgent.

PARAMETER DESCRIPTION
realtime_agent

The RealtimeAgent to create the SwarmableRealtimeAgent from.

TYPE: RealtimeAgent

initial_agent

The initial agent.

TYPE: ConversableAgent

agents

The agents in the swarm.

TYPE: list[ConversableAgent]

system_message

The system message to set for the agent. If None, the default system message is used.

TYPE: Optional[str] DEFAULT: None

question_message

The question message to set for the agent. If None, the default QUESTION_MESSAGE is used.

TYPE: Optional[str] DEFAULT: None

Source code in autogen/agentchat/realtime/experimental/realtime_swarm.py
@export_module("autogen.agentchat.realtime.experimental")
def register_swarm(
    *,
    realtime_agent: "RealtimeAgent",
    initial_agent: ConversableAgent,
    agents: list[ConversableAgent],
    system_message: Optional[str] = None,
    question_message: Optional[str] = None,
) -> None:
    """Create a SwarmableRealtimeAgent.

    Args:
        realtime_agent (RealtimeAgent): The RealtimeAgent to create the SwarmableRealtimeAgent from.
        initial_agent (ConversableAgent): The initial agent.
        agents (list[ConversableAgent]): The agents in the swarm.
        system_message (Optional[str]): The system message to set for the agent. If None, the default system message is used.
        question_message (Optional[str]): The question message to set for the agent. If None, the default QUESTION_MESSAGE is used.
    """
    swarmable_agent = SwarmableRealtimeAgent(
        realtime_agent=realtime_agent, initial_agent=initial_agent, agents=agents, question_message=question_message
    )

    swarmable_agent.configure_realtime_agent(system_message=system_message)