Overview
MultiAgentHub is an abstract base class for managing multiple agents in Qwen-Agent. It provides a unified interface for accessing and managing a collection of agents with validation to ensure proper configuration.
Class Signature
Properties
agents
List of Agent instances
- Must have an
_agentsattribute of typeList[Agent] - The list must be non-empty (at least one agent)
- All agents must have non-empty string names
- Agent names must be unique within the hub
AttributeErrororAssertionErrorif validation fails
agent_names
List of agent names
nonuser_agents
UserAgent instances.
List of non-user agents
Implementation Requirements
Classes that inherit fromMultiAgentHub must:
- Define an
_agentsattribute containing a list ofAgentinstances - Ensure all agents have unique, non-empty names
- Maintain at least one agent in the list