A utility class for automatically generating and managing task-specific agents
based on a given high-level task description.
This class uses a sequential pipeline of two agents:
1. `task_generator` – Breaks down a high-level task into smaller,
structured subtasks.
2. `agent_generator` – Creates dedicated agents for each subtask with
specific system prompts and configurations.
The resulting agents are combined into an `AutoAgentManager` for coordinated
execution, ensuring that the output from one agent feeds into the next.
Attributes:
agent_factory (AgentFactory): Factory for creating agents with predefined
settings.
task_generator (Agent): The agent responsible for generating subtasks
from a high-level task description.
agent_generator (Agent): The agent responsible for creating specialized
agents based on generated subtasks.
sequencial_agent (SimpleSequentialAgents): Manages the execution of
`task_generator` followed by `agent_generator`.
agents (list): Stores created agents.
Args:
agent_factory (AgentFactory): The factory used to create new agents.
max_token (int, optional): Maximum token limit for each agent. Defaults
to 1024.
Methods:
create_agent(task: str, init_message: str = None) -> list[Agent]:
Generates agents for a given high-level task, creates an
AutoAgentManager to run them, and returns the configured manager.
The process:
- Pass the task to the sequential pipeline.
- Convert generated subtask definitions into real agents.
- Initialize an AutoAgentManager for coordinated multi-agent execution.