prepare_group_agents

prepare_group_agents(
    agents: list['ConversableAgent'],
    context_variables: ContextVariables,
    exclude_transit_message: bool = True
) -> tuple[GroupToolExecutor, list['ConversableAgent']]

Validates agents, create the tool executor, wrap necessary targets in agents.

Parameters:
NameDescription
agentsList of all agents in the conversation.

Type: list[‘ConversableAgent’]
context_variablesContext variables to assign to all agents.

Type: ContextVariables
exclude_transit_messageWhether to exclude transit messages from the agents.

Type: bool

Default: True
Returns:
TypeDescription
tuple[GroupToolExecutor, list[‘ConversableAgent’]]“ConversableAgent”: The tool executor agent. list[“ConversableAgent”]: List of wrapped agents.